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”

      command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update

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

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

And Artisan config

location: “.ebextensions/02artisan.config”

      command: "php artisan migrate --force"

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

Leave a Reply

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

You are commenting using your 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