Skip to content

Instantly share code, notes, and snippets.

@bcreeves
Created April 30, 2019 18:53
Show Gist options
  • Save bcreeves/bc228bc86ac9fda3f330bb3141bccc23 to your computer and use it in GitHub Desktop.
Save bcreeves/bc228bc86ac9fda3f330bb3141bccc23 to your computer and use it in GitHub Desktop.
Laravel git hook for deployment to cpanel server
#!/bin/sh
umask 022
GIT_WORK_TREE=~/laravel git checkout -f
cd ~/laravel
scl enable ea-php72 'php artisan config:cache'
# Check if composer.json exists
if [ -f composer.json ]; then
scl enable ea-php72 'composer install'
scl enable ea-php72 'composer dump-autoload'
fi
scl enable ea-php72 'php artisan migrate --force'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment