Skip to content

Instantly share code, notes, and snippets.

@rezuankassim
Last active August 9, 2021 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rezuankassim/e6ef20ad9b410c76ad8114af4ab6ac2c to your computer and use it in GitHub Desktop.
Save rezuankassim/e6ef20ad9b410c76ad8114af4ab6ac2c to your computer and use it in GitHub Desktop.
PawnBroker deploy.sh
# Change to the project directory
cd /var/www/html/pawnbroker
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
sudo git pull
# Install/update composer dependecies
composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev
# Run database migrations for host
php artisan migrate --path=database/migrations/host --database=host --force
# Run database migrations for client
php artisan tenants:artisan "migrate --database=client --force"
# Clear caches for host
sudo php artisan cache:clear
# Clear caches for client
sudo php artisan tenants:artisan "cache:clear"
# Run roles and permissions seeder for new permission
php artisan db:seed --class="Database\Seeders\Host\RolesAndPermissionsSeeder" --database=host --force
# Clear permission caches
sudo php artisan permission:cache-reset
# Clear expired password reset tokens
php artisan auth:clear-resets
# Clear and cache routes
php artisan route:clear
php artisan route:cache
# Clear and cache config
php artisan config:clear
php artisan config:cache
# Clear and cache views
php artisan view:clear
php artisan view:cache
# Install node modules
yarn install
# Build assets using Laravel Mix
yarn prod
# Purge horizon
# php artisan horizon:purge
# Terminate horizon
# sudo php artisan horizon:terminate
# Restart queue
# sudo php artisan queue:restart
# Turn off maintenance mode
php artisan up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment