gru/deploy.sh
2023-07-07 06:38:14 +05:30

32 lines
778 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
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
# ./version_bump.sh
# fi
# Download the package.json for caching
curl --silent 'https://git.tanshu.com/tanshu/gru/raw/tag/latest/pyproject.toml' \
| sed 's/version = \"[0-9\.]*\"/version = "0.0.0"/g' \
> "$parent_path/docker/app/pyproject.toml"
cd "$parent_path/docker/app" || exit
docker build --tag gru:latest .
if [ 1 -eq "$#" ]
then
docker tag gru:latest "$1"
else
echo "No version bump"
fi
cd "$parent_path/docker" || exit
docker save gru:latest | bzip2 | pv | ssh beacon 'bunzip2 | sudo docker load'
ansible-playbook --limit=beacon playbook.yml