Skip to content

Instantly share code, notes, and snippets.

@scrubmx
Last active August 22, 2017 20:05
Show Gist options
  • Select an option

  • Save scrubmx/aaa80be39779f7d2d203dc2deef56497 to your computer and use it in GitHub Desktop.

Select an option

Save scrubmx/aaa80be39779f7d2d203dc2deef56497 to your computer and use it in GitHub Desktop.
Laravel deploy script
# Change to the project directory
cd /home/forge/appname.com
# Put the application into maintenance mode
php artisan down
# Get the latests changes
git pull origin master
# Install composer dependecies
composer install --no-interaction --no-dev --prefer-dist
# Run database migrations
php artisan migrate --force
# Cache the application routes
php artisan route:clear
php artisan route:cache
# Cache the configuration files
php artisan config:clear
php artisan config:cache
# Flush expired password reset tokens
php artisan auth:clear-resets
# Optimize the framework for better performance
php artisan optimize --force
# Submit a deployment notification to bugsnag
# php artisan bugsnag:deploy \
# --repository "https://github.com/scrubmx/appname" \
# --branch "master" \
# --revision "$(git rev-parse HEAD)"
# Restart the queue workers
sudo supervisorctl restart appname
# Bring the application out of maintenance mode
php artisan up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment