2021-01-25 07:44:17 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-05-09 18:26:51 +00:00
|
|
|
set -euo pipefail
|
2021-01-25 07:44:17 +00:00
|
|
|
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
|
|
|
|
cd "$parent_path" || exit
|
2022-05-09 18:26:51 +00:00
|
|
|
|
|
|
|
./lint.sh
|
2021-01-25 07:44:17 +00:00
|
|
|
|
|
|
|
if [ 1 -eq "$#" ]
|
|
|
|
then
|
|
|
|
./version_bump.sh "$1"
|
|
|
|
else
|
2021-09-10 07:56:16 +00:00
|
|
|
./version_bump.sh
|
2021-01-25 07:44:17 +00:00
|
|
|
fi
|
|
|
|
|
2021-10-31 13:17:25 +00:00
|
|
|
# Download the package.json for caching
|
|
|
|
curl --silent 'https://git.tanshu.com/tanshu/brewman/raw/tag/latest/overlord/package.json' \
|
|
|
|
| sed 's/\"version\": \"[0-9\.]*\"/"version": "0.0.0"/g' \
|
|
|
|
> "$parent_path/docker/app/package.json"
|
|
|
|
|
|
|
|
# Download the package.json for caching
|
|
|
|
curl --silent 'https://git.tanshu.com/tanshu/brewman/raw/tag/latest/brewman/pyproject.toml' \
|
|
|
|
| sed 's/version = \"[0-9\.]*\"/version = "0.0.0"/g' \
|
|
|
|
> "$parent_path/docker/app/pyproject.toml"
|
|
|
|
|
|
|
|
|
2021-01-25 07:44:17 +00:00
|
|
|
cd "$parent_path/docker/app" || exit
|
|
|
|
docker build --tag brewman:latest .
|
2022-05-09 18:26:51 +00:00
|
|
|
if [ 1 -eq "$#" ]
|
|
|
|
then
|
|
|
|
docker tag brewman:latest "$1"
|
|
|
|
else
|
|
|
|
echo "No version bump"
|
|
|
|
fi
|
2021-01-25 07:44:17 +00:00
|
|
|
cd "$parent_path/docker" || exit
|
2022-07-05 01:39:44 +00:00
|
|
|
docker save brewman:latest | bzip2 | pv | ssh beacon 'bunzip2 | sudo docker load'
|
2022-06-07 13:00:39 +00:00
|
|
|
ansible-playbook --inventory hosts playbook.yml
|