Created
January 15, 2020 12:37
-
-
Save vanduc1102/1da4e6a953f4468d9ebecf6d5121c76f to your computer and use it in GitHub Desktop.
checkout code and reload nodejs server
This file contains 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
#!/bin/sh | |
# It is good practice to print the required versions on server. | |
# cause the code will execute in SSH non interactively mode. | |
# https://stackoverflow.com/questions/17089808/how-to-do-remote-ssh-non-interactively | |
echo "NodeJS: "$(node -v) | |
echo "NPM: "$(npm -v) | |
WORKSPACE=/working_directory/public_html | |
echo "Working directory: " $WORKSPACE | |
cd $WORKSPACE | |
git checkout develop -f | |
echo "===================Install dependencies ===========" | |
npm install | |
echo "===================Finished install dependencies ========" | |
echo "RELOAD ENV" | |
pm2 reload $WORKSPACE/ecosystem.config.js --env production --update-env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment