Last active
April 15, 2020 18:17
-
-
Save ajmas/b31f914a70ec32a12a3c8779d667f0cd to your computer and use it in GitHub Desktop.
Deployment Script
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 | |
project=myapp | |
repo_path=~/repositories/${project} | |
dist_path=~/repositories/${project} | |
deploy_dir=/usr/local/${project} | |
export env=prod | |
cd "${repo_path}" | |
git checkout . | |
git checkout prod | |
git pull | |
git_branch=`git branch | grep \* | cut -d ' ' -f2` | |
git_hash=`git rev-parse HEAD` | |
## This should probably be done as part of the CI and have a release tarball available | |
npm install | |
scripts/generate-appinfo.sh "${git_branch}" "${git_hash}" src/appinfo.json | |
npm run build | |
npm install --production | |
rsync --exclude="/.*" --exclude=test_data \ | |
-avh "${dist_path}/" "${deploy_dir}" --delete | |
cd "${deploy_dir}" | |
./scripts/nodectl.sh restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment