Guest User

Untitled

a guest
Mar 2nd, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. # The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk.
  2. # Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config)
  3.  
  4. # -------------------------------- Commands ------------------------------------
  5. # Use "commands" key to execute commands on the EC2 instance. The commands are
  6. # processed in alphabetical order by name, and they run before the application
  7. # and web server are set up and the application version file is extracted.
  8. # ------------------------------------------------------------------------------
  9. commands:
  10. 01updateComposer:
  11. command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
  12.  
  13. option_settings:
  14. - namespace: aws:elasticbeanstalk:application:environment
  15. option_name: COMPOSER_HOME
  16. value: /root
  17.  
  18. - namespace: aws:elasticbeanstalk:container:php:phpini
  19. option_name: document_root
  20. value: /public
  21.  
  22. - namespace: aws:elasticbeanstalk:container:php:phpini
  23. option_name: memory_limit
  24. value: 512M
  25.  
  26. # Create RDS database, requires adding env variables.
  27. # Resources:
  28. # AWSEBRDSDatabase:
  29. # Type: AWS::RDS::DBInstance
  30. # Properties:
  31. # AllocatedStorage: 5
  32. # DBInstanceClass: db.t1.micro
  33. # DBName: #insert db name
  34. # Engine: mysql
  35. # EngineVersion: 5.6
  36. # MasterUsername: #insert name
  37. # MasterUserPassword: #insert pass
  38.  
  39. # ---------------------------- Container Commands ------------------------------
  40. # You can use the container_commands key to execute commands for your container.
  41. # The commands in container_commands are processed in alphabetical order by
  42. # name. They run after the application and web server have been set up and the
  43. # application version file has been extracted, but before the application
  44. # version is deployed. They also have access to environment variables such as
  45. # your AWS security credentials. Additionally, you can use leader_only. One
  46. # instance is chosen to be the leader in an Auto Scaling group. If the
  47. # leader_only value is set to true, the command runs only on the instance
  48. # that is marked as the leader.
  49. #
  50. # Artisan commands include environment flag for production. If you are not
  51. # deploying to a production environment, update the flag.
  52. # ------------------------------------------------------------------------------
  53.  
  54. container_commands:
  55. 01express:
  56. command: "echo AWS Container Commands started, starting Composer install."
  57. 02installComposer:
  58. command: "php /opt/elasticbeanstalk/support/composer.phar install"
  59. cwd: "/var/app/ondeck"
  60. 03express:
  61. command: "echo Composer install completed, starting Laravel migration"
  62. 04migrations:
  63. command: "php artisan migrate --env=production"
  64. cwd: "/var/app/ondeck"
  65. 05express:
  66. command: "echo Completed Laravel migration, starting Laravel database seeding"
  67. 06seeds:
  68. command: "php artisan db:seed --env=production"
  69. cwd: "/var/app/ondeck"
  70. leader_only: true
  71. 07express:
  72. command: "echo Completed database seeting, Container Commands complete."
Add Comment
Please, Sign In to add comment