Skip to content

Instantly share code, notes, and snippets.

@scrubmx
Created March 9, 2015 02:10
Show Gist options
  • Save scrubmx/bdc51b990167a21dbacf to your computer and use it in GitHub Desktop.
Save scrubmx/bdc51b990167a21dbacf to your computer and use it in GitHub Desktop.
Laravel 5 AWS elastic beanstalk post deploy configuration file.
commands:
composer_update:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
container_commands:
01-install_composer:
command: "curl -s http://getcomposer.org/installer | php"
cwd: "/var/app/ondeck"
02-install_dependencies:
command: "php composer.phar install"
cwd: "/var/app/ondeck"
03-cleanup_composer:
command: "rm -Rf composer.*"
cwd: "/var/app/ondeck"
04-artisan_migrate:
command: "php artisan migrate --force"
cwd: "/var/app/ondeck"
leader_only: true
@spawn-guy
Copy link

why do you need to install the composer? and not only update it. as composer is installed(outdated, yes) in the eb AMI

@publiux
Copy link

publiux commented Apr 22, 2015

I agree with spawn-guy. I don't see why you should install composer again in the root of the project, install vendor files, then delete composer when you already updated the composer.phar file in your first command. I think you would just call php /usr/bin/composer.phar install as a container command (and php artisan migrate if you need it of course).

@buluxan
Copy link

buluxan commented Jun 1, 2016

sorry for the out of topic
can we use this config for 2 machine for example staging and production and
do u know how to put the .env.staging and .env.production during post deployment from elasticbeanstalk in root directory

@evendrop
Copy link

Good job! very useful, even for latest lumen.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment