add script to easily do a version upgrade for a docker compose project

This commit is contained in:
Siddhartha Golu 2024-03-08 13:01:37 +05:30
parent 527cae512e
commit 8653946c20
1 changed files with 18 additions and 0 deletions

18
version-upgrade.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# Get the new version from the command line argument
new_version=$1
if [ -z "$new_version" ]; then
echo "Usage: $0 <new_version>"
exit 1
fi
# Bring the stack down
docker compose down
# Update the APP_VERSION value in .env file
sed -i "s/APP_VERSION=.*$/APP_VERSION=$new_version/" .env
# Bring the stack back up
docker compose up -d