Chore: Update deploy and version bump scripts

This commit is contained in:
Amritanshu Agrawal 2022-04-17 13:50:11 +05:30
parent ee8cde46b7
commit 7621275c74
2 changed files with 22 additions and 18 deletions

View File

@ -9,11 +9,16 @@ then
./version_bump.sh "$1" ./version_bump.sh "$1"
else else
echo "No version bump" echo "No version bump"
git push
fi fi
cd docker/app || exit cd docker/app || exit
docker build --tag luthor:latest . docker build --tag luthor:latest .
if [ 1 -eq "$#" ]
then
docker tag luthor:latest "$1"
else
echo "No version bump"
fi
cd "$parent_path/docker" || exit cd "$parent_path/docker" || exit
docker save luthor:latest | bzip2 | pv | ssh tanshu@knox.tanshu.com 'bunzip2 | sudo docker load' docker save luthor:latest | bzip2 | pv | ssh tanshu@anubhachambers.com 'bunzip2 | sudo docker load'
ansible-playbook playbook.yml ansible-playbook --limit=anubha playbook.yml

View File

@ -2,15 +2,11 @@
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P ) parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P )
cd "$parent_path" || exit cd "$parent_path" || exit
if [ 1 -ne "$#" ] if [ 1 -eq "$#" ]
then then
echo "Usage: `basename $0` Version: eg. 9.0.0" echo "Version bump to $1"
exit 0 sed --in-place --regexp-extended 's/version = "([0-9].[0-9].[0-9])"/version = "'"$1"'"/g' luthor/pyproject.toml
fi git add luthor/pyproject.toml
sed --in-place --regexp-extended 's/"([0-9].[0-9].[0-9])"/"'"$1"'"/g' luther/luther/__version__.py
git add luther/luther/__version__.py
sed --in-place --regexp-extended 's/version = "([0-9].[0-9].[0-9])"/version = "'"$1"'"/g' luther/pyproject.toml
git add luther/pyproject.toml
sed --in-place --regexp-extended 's/version: '\''([0-9].[0-9].[0-9])'\''/version: '\'"$1"\''/g' otis/src/environments/environment.prod.ts sed --in-place --regexp-extended 's/version: '\''([0-9].[0-9].[0-9])'\''/version: '\'"$1"\''/g' otis/src/environments/environment.prod.ts
git add otis/src/environments/environment.prod.ts git add otis/src/environments/environment.prod.ts
sed --in-place --regexp-extended 's/version: '\''([0-9].[0-9].[0-9])'\''/version: '\'"$1"\''/g' otis/src/environments/environment.ts sed --in-place --regexp-extended 's/version: '\''([0-9].[0-9].[0-9])'\''/version: '\'"$1"\''/g' otis/src/environments/environment.ts
@ -18,9 +14,12 @@ git add otis/src/environments/environment.ts
sed --in-place --regexp-extended 's/"version": "([0-9].[0-9].[0-9])"/"version": "'"$1"'"/g' otis/package.json sed --in-place --regexp-extended 's/"version": "([0-9].[0-9].[0-9])"/"version": "'"$1"'"/g' otis/package.json
git add otis/package.json git add otis/package.json
git commit -m "Version Bump v$1" git commit -m "Version Bump v$1"
git tag "v$1"
else
echo "No version bump"
fi
git push git push
git tag --delete latest git tag --delete latest
git tag latest git tag latest
git tag "v$1"
git push --delete origin latest git push --delete origin latest
git push --tags git push --tags