Beanstalk configuration for laravel part 1

To automate composer updates and laravel artisan commands whenever you upload updated codes to AWS elastic beanstalk, you need to configure some commands. The locations are relative to your laravel’s root folder, not server root.

Here is my configuration for composer in Beanstalk.

Make sure you uploaded “composer.phar” in laravel root, too.

location: “.ebextensions/01composer.config”

 
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

container_commands:
   01optimize:
      command: "/usr/bin/composer.phar dump-autoload --optimize"

And Artisan config

location: “.ebextensions/02artisan.config”

container_commands:
   01migrateSeed:
      command: "php artisan migrate --force"

Because your “production server” won’t allow migrate without “–force” parameter!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s