From 8653946c20f93f7a0c80977d6da90aad4a57740a Mon Sep 17 00:00:00 2001 From: Siddhartha Golu Date: Fri, 8 Mar 2024 13:01:37 +0530 Subject: [PATCH] add script to easily do a version upgrade for a docker compose project --- version-upgrade.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 version-upgrade.sh diff --git a/version-upgrade.sh b/version-upgrade.sh new file mode 100755 index 0000000..7c1bda6 --- /dev/null +++ b/version-upgrade.sh @@ -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 " + 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