Last active
April 9, 2018 11:46
-
-
Save DaMandal0rian/a6e308cd905b7a4e5b130c4161cb89da to your computer and use it in GitHub Desktop.
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 -e | |
| unset GIT_WORK_TREE | |
| export GIT_WORK_TREE="/var/www/example.com" | |
| export NODE_VERSION="8.9.3" | |
| export NODE_ENV=production | |
| # export NODE_PATH=/home/motif/bin/node | |
| echo "--> Checking out..." | |
| git --work-tree=$GIT_WORK_TREE --git-dir=/var/repos/myrepo.git checkout -f master | |
| echo "--> Selecting Node version $NODE_VERSION" | |
| . $HOME/.nvm/nvm.sh | |
| nvm use $NODE_VERSION | |
| echo "--> Installing libraries..." | |
| cd "$GIT_WORK_TREE" | |
| npm install | |
| gulp | |
| echo "--> Restart server..." | |
| pm2 restart {appname} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment