Last active
June 21, 2018 16:54
-
-
Save oriolclosa/568922b54574cb5dd64bd203304523ee to your computer and use it in GitHub Desktop.
Autodeploy GitHub Node projects
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
| #!/bin/bash | |
| echo `date`" Checking for new version..." >> result-deploy.log | |
| git pull > result-git.log | |
| OK=`cat result-git.log | grep "Already up-to-date."` | |
| if [[ $OK == "" ]]; then | |
| npm run dist > result-npm.log | |
| OK=`cat result-npm.log | grep "Success!"` | |
| if [[ $OK != "" ]]; then | |
| rm -rf web/testing-OLD > /dev/null 2>&1 | |
| mv web/testing web/testing-OLD > /dev/null 2>&1 | |
| mv dist web/testing > /dev/null 2>&1 | |
| echo `date`" New version deployed!" >> result-deploy.log | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment