Last active
May 10, 2020 05:55
-
-
Save worldwise001/a76c9717d988441cba2c004cfa5df93d to your computer and use it in GitHub Desktop.
artifact "build" + "deploy" script
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 | |
if [[ "$1" = "" ]]; then | |
echo "need to specify app as argument" | |
exit 1 | |
fi | |
app="$1" | |
pushd /srv/http | |
git clone https://YOUR_GITHUB_HERE/$app.git ${app}_latest | |
pushd /srv/http/${app}_latest | |
latest=`git rev-parse HEAD` | |
popd | |
if [[ ! -d "/srv/http/${app}_${latest}" ]]; then | |
mv ${app}_latest ${app}_${latest} | |
pushd ${app}_${latest} | |
python -m venv venv | |
source venv/bin/activate | |
pip install -r requirements.txt | |
python setup.py install | |
deactivate | |
pushd webapp | |
npm install | |
npm run build | |
popd | |
popd | |
rm /srv/http/$app | |
ln -s /srv/http/${app}_${latest} /srv/http/$app | |
else | |
rm -r /srv/${app}_latest | |
fi | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment