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"
else
echo "No version bump"
git push
fi
cd docker/app || exit
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
docker save luthor:latest | bzip2 | pv | ssh tanshu@knox.tanshu.com 'bunzip2 | sudo docker load'
ansible-playbook playbook.yml
docker save luthor:latest | bzip2 | pv | ssh tanshu@anubhachambers.com 'bunzip2 | sudo docker load'
ansible-playbook --limit=anubha playbook.yml

View File

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