37 lines
600 B
Bash
37 lines
600 B
Bash
|
#!/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
|