-
-
Save pdl5p/cac63f51ed2c1d48adcd6ef373b28903 to your computer and use it in GitHub Desktop.
Customized Azure deployment script that will run Gulp tasks during deployment
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
| ################################################################################################################################## | |
| # Deployment | |
| # ---------- | |
| echo Handling node.js deployment. | |
| # 1. Select node version | |
| selectNodeVersion | |
| # 2. Install npm packages | |
| if [ -e "$DEPLOYMENT_SOURCE/package.json" ]; then | |
| cd "$DEPLOYMENT_SOURCE" | |
| eval $NPM_CMD install --production | |
| exitWithMessageOnError "npm failed" | |
| cd - > /dev/null | |
| fi | |
| # 3. Run gulp tasks | |
| if [ -e "$DEPLOYMENT_SOURCE/gulpfile.js" ]; then | |
| echo "Running gulp tasks" | |
| cd "$DEPLOYMENT_SOURCE" | |
| eval './node_modules/.bin/gulp' | |
| exitWithMessageOnError "gulp failed" | |
| cd - > /dev/null | |
| fi | |
| # 4. KuduSync | |
| if [[ "$IN_PLACE_DEPLOYMENT" -ne "1" ]]; then | |
| "$KUDU_SYNC_CMD" -v 50 -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh;node_modules;package.json;gulpfile.js;.gitignore;.htaccess" | |
| exitWithMessageOnError "Kudu Sync failed" | |
| fi | |
| ################################################################################################################################## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment