barker/deploy.sh
2021-03-17 09:39:56 +05:30

27 lines
740 B
Bash
Executable File

#!/usr/bin/env bash
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
cd "$parent_path" || exit
./lint.sh
if [ 1 -eq "$#" ]
then
./version_bump.sh "$1"
else
echo "No version bump"
git push
git tag --delete latest
git tag latest
git push --delete origin latest
git push --tags
fi
cd docker/app || exit
docker build --tag barker:latest .
docker build --tag barker-worker:latest --file worker.Dockerfile .
cd "$parent_path/docker" || exit
docker save barker:latest | bzip2 | pv | ssh tanshu@knox.tanshu.com 'bunzip2 | sudo docker load'
docker save barker-worker:latest | bzip2 | pv | ssh tanshu@knox.tanshu.com 'bunzip2 | sudo docker load'
ansible-playbook playbook-chd.yml
ansible-playbook playbook-pkl.yml