Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aimeric/bb1de027c11e0ce97a262116bc6f71a4 to your computer and use it in GitHub Desktop.

Select an option

Save aimeric/bb1de027c11e0ce97a262116bc6f71a4 to your computer and use it in GitHub Desktop.

Revisions

  1. @harrisonde harrisonde revised this gist May 28, 2015. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -46,6 +46,9 @@ option_settings:
    # instance is chosen to be the leader in an Auto Scaling group. If the
    # leader_only value is set to true, the command runs only on the instance
    # that is marked as the leader.
    #
    # Artisan commands include environment flag for production. If you are not
    # deploying to a production environment, update the flag.
    # ------------------------------------------------------------------------------

    container_commands:
    @@ -62,7 +65,7 @@ container_commands:
    05express:
    command: "echo Completed Laravel migration, starting Laravel database seeding"
    06seeds:
    command: "php artisan db:seed"
    command: "php artisan db:seed --env=production"
    cwd: "/var/app/ondeck"
    leader_only: true
    07express:
  2. @harrisonde harrisonde revised this gist May 28, 2015. 1 changed file with 13 additions and 12 deletions.
    25 changes: 13 additions & 12 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -22,18 +22,19 @@ option_settings:
    - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: memory_limit
    value: 512M

    Resources:
    AWSEBRDSDatabase:
    Type: AWS::RDS::DBInstance
    Properties:
    AllocatedStorage: 5
    DBInstanceClass: db.t1.micro
    DBName: #insert db name
    Engine: mysql
    EngineVersion: 5.6
    MasterUsername: #insert name
    MasterUserPassword: #insert pass

    # Create RDS database, requires adding env variables.
    # Resources:
    # AWSEBRDSDatabase:
    # Type: AWS::RDS::DBInstance
    # Properties:
    # AllocatedStorage: 5
    # DBInstanceClass: db.t1.micro
    # DBName: #insert db name
    # Engine: mysql
    # EngineVersion: 5.6
    # MasterUsername: #insert name
    # MasterUserPassword: #insert pass

    # ---------------------------- Container Commands ------------------------------
    # You can use the container_commands key to execute commands for your container.
  3. @harrisonde harrisonde revised this gist May 27, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ container_commands:
    03express:
    command: "echo Composer install completed, starting Laravel migration"
    04migrations:
    command: "php artisan migrate --force"
    command: "php artisan migrate --env=production"
    cwd: "/var/app/ondeck"
    05express:
    command: "echo Completed Laravel migration, starting Laravel database seeding"
  4. @harrisonde harrisonde revised this gist May 27, 2015. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -22,6 +22,18 @@ option_settings:
    - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: memory_limit
    value: 512M

    Resources:
    AWSEBRDSDatabase:
    Type: AWS::RDS::DBInstance
    Properties:
    AllocatedStorage: 5
    DBInstanceClass: db.t1.micro
    DBName: #insert db name
    Engine: mysql
    EngineVersion: 5.6
    MasterUsername: #insert name
    MasterUserPassword: #insert pass

    # ---------------------------- Container Commands ------------------------------
    # You can use the container_commands key to execute commands for your container.
  5. @harrisonde harrisonde revised this gist May 21, 2015. No changes.
  6. @harrisonde harrisonde revised this gist May 21, 2015. No changes.
  7. @harrisonde harrisonde created this gist May 21, 2015.
    56 changes: 56 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,56 @@
    # The following script will deploy a Laravel 5 applicaion on AWS Elastic Beanstalk.
    # Add to .ebextensions at the root of your application and name your commands file (e.g., commands.config)

    # -------------------------------- Commands ------------------------------------
    # Use "commands" key to execute commands on the EC2 instance. The commands are
    # processed in alphabetical order by name, and they run before the application
    # and web server are set up and the application version file is extracted.
    # ------------------------------------------------------------------------------
    commands:
    01updateComposer:
    command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update

    option_settings:
    - namespace: aws:elasticbeanstalk:application:environment
    option_name: COMPOSER_HOME
    value: /root

    - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: document_root
    value: /public

    - namespace: aws:elasticbeanstalk:container:php:phpini
    option_name: memory_limit
    value: 512M

    # ---------------------------- Container Commands ------------------------------
    # You can use the container_commands key to execute commands for your container.
    # The commands in container_commands are processed in alphabetical order by
    # name. They run after the application and web server have been set up and the
    # application version file has been extracted, but before the application
    # version is deployed. They also have access to environment variables such as
    # your AWS security credentials. Additionally, you can use leader_only. One
    # instance is chosen to be the leader in an Auto Scaling group. If the
    # leader_only value is set to true, the command runs only on the instance
    # that is marked as the leader.
    # ------------------------------------------------------------------------------

    container_commands:
    01express:
    command: "echo AWS Container Commands started, starting Composer install."
    02installComposer:
    command: "php /opt/elasticbeanstalk/support/composer.phar install"
    cwd: "/var/app/ondeck"
    03express:
    command: "echo Composer install completed, starting Laravel migration"
    04migrations:
    command: "php artisan migrate --force"
    cwd: "/var/app/ondeck"
    05express:
    command: "echo Completed Laravel migration, starting Laravel database seeding"
    06seeds:
    command: "php artisan db:seed"
    cwd: "/var/app/ondeck"
    leader_only: true
    07express:
    command: "echo Completed database seeting, Container Commands complete."