Added script for auto deployment

This commit is contained in:
Sebastian 2019-12-20 14:01:00 +01:00
parent 8978b674b1
commit 0088db46bf
1 changed files with 36 additions and 0 deletions

36
deploy.sh Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <destionation>"
exit -1
fi
DEST="$1"
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
cd $DIR
echo "Repo directory is $DIR"
git pull
git rev-parse HEAD > .tmp_id
if [ -d output ] && [ -f .head_id ] && diff -q .head_id .tmp_id; then
rm .tmp_id
echo "No changes since last run"
exit 0
fi
if [ ! -d ./virtenv ]; then
python3 -m venv virtenv
fi
source virtenv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
rm -rf output
nikola build
rsync -Pvrt --delete ./output/ $DEST
mv .tmp_id .head_id