Skip to content

Instantly share code, notes, and snippets.

@Aleksandar-Mitic
Created October 21, 2020 06:53
Show Gist options
  • Save Aleksandar-Mitic/3553ea332fe32e54579ee642a10ce1b6 to your computer and use it in GitHub Desktop.
Save Aleksandar-Mitic/3553ea332fe32e54579ee642a10ce1b6 to your computer and use it in GitHub Desktop.
Production linux script for updating laravel codebase from git & restarting services
#!/bin/bash
set -x
git reset --hard HEAD
git pull
composer install --no-interaction --no-dev
#php artisan route:cache
php artisan event:cache
php artisan view:cache
php artisan config:cache
#php artisan optimize
composer dump-autoload --no-interaction --no-dev --optimize --classmap-authoritative
systemctl reload php7.4-fpm.service
php artisan queue:restart
# Optional if queue or horizon config has changed
#sudo supervisorctl reread
#sudo supervisorctl update
#sudo supervisorctl start all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment