Just some git hooks I'm putting together
Last active
December 8, 2017 15:59
-
-
Save jesgs/82895dfe36c52de4e3e626a5271445f6 to your computer and use it in GitHub Desktop.
Git post-receive hook for running npm run production on Laravel installs
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
#!/usr/bin/env bash | |
set -u | |
set -e | |
export GIT_WORK_TREE="/home/jess/psy-dreamer.com" | |
export NODE_VERSION="8.7.0" | |
echo "--> Selecting Node version $NODE_VERSION" | |
. $HOME/.nvm/nvm.sh | |
nvm use $NODE_VERSION | |
echo "--> run npm run production..." | |
cd "$GIT_WORK_TREE" | |
npm run production | |
echo "--> run php artisan migrate..." | |
php artisan migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment