Last active
September 21, 2018 23:53
-
-
Save vedmant/10a2ea407ec0a880a7e5811191f91c6d to your computer and use it in GitHub Desktop.
A script for deploying Laravel application, includes maintenance mode, composer, migrations, clearing cache and restart queues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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