Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A script for deploying Laravel application, includes maintenance mode, composer, migrations, clearing cache and restart queues
#!/bin/bash
NO_DEV="--no-dev"
if [[ $1 == "dev" ]]; then
NO_DEV=""
fi
git fetch
if [[ `git rev-parse HEAD` != `git rev-parse @{u}` ]]; then
php artisan down
git pull
composer install $NO_DEV --optimize-autoloader
php artisan migrate --force
php artisan optimize
php artisan cache:clear
php artisan up
php artisan queue:restart
else
echo 'Already up to date. Nothing to deploy'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.