From df392f7b7f9e804779feb4d9af0a85175b01acf5 Mon Sep 17 00:00:00 2001 From: "Adrian A. Baumann" Date: Tue, 19 May 2026 01:27:15 +0200 Subject: [PATCH] Image tag corrected --- argocd/configmap.yaml | 2 +- argocd/deployment.yaml | 2 +- scripts/full_deploy.sh | 13 ++++++++++++- scripts/partial_deploy.sh | 13 ++++++++++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/argocd/configmap.yaml b/argocd/configmap.yaml index 0a81378..f96e32d 100644 --- a/argocd/configmap.yaml +++ b/argocd/configmap.yaml @@ -21,4 +21,4 @@ data: LOGOUT_REDIRECT_URL: "/login/" OIDC_AUTHENTICATION_FAILURE_REDIRECT_URL: "/login/" GUNICORN_OPTS: "--access-logfile -" - IMAGE_TAG: "0.079" + IMAGE_TAG: "0.086" diff --git a/argocd/deployment.yaml b/argocd/deployment.yaml index 2aab36b..523b5b5 100644 --- a/argocd/deployment.yaml +++ b/argocd/deployment.yaml @@ -27,7 +27,7 @@ spec: mountPath: /data containers: - name: web - image: git.baumann.gr/adebaumann/labhelper:0.084 + image: git.baumann.gr/adebaumann/labhelper:0.086 imagePullPolicy: Always ports: - containerPort: 8000 diff --git a/scripts/full_deploy.sh b/scripts/full_deploy.sh index 5901818..1ebd4d7 100755 --- a/scripts/full_deploy.sh +++ b/scripts/full_deploy.sh @@ -2,6 +2,7 @@ # Full deployment script - bumps both container versions by 0.001 and copies database DEPLOYMENT_FILE="argocd/deployment.yaml" +CONFIGMAP_FILE="argocd/configmap.yaml" DB_SOURCE="data/db.sqlite3" DB_DEST="data-loader/preload.sqlite3" @@ -11,6 +12,11 @@ if [ ! -f "$DEPLOYMENT_FILE" ]; then exit 1 fi +if [ ! -f "$CONFIGMAP_FILE" ]; then + echo "Error: $CONFIGMAP_FILE not found" + exit 1 +fi + # Check if source database exists if [ ! -f "$DB_SOURCE" ]; then echo "Error: $DB_SOURCE not found" @@ -37,7 +43,12 @@ sed -i "s|image: git.baumann.gr/adebaumann/labhelper-data-loader:$LOADER_VERSION sed -i "s|image: git.baumann.gr/adebaumann/labhelper:$MAIN_VERSION|image: git.baumann.gr/adebaumann/labhelper:$NEW_MAIN_VERSION|" "$DEPLOYMENT_FILE" # Update ConfigMap with new main container version -sed -i "s| IMAGE_TAG: \"$MAIN_VERSION\"| IMAGE_TAG: \"$NEW_MAIN_VERSION\"|" "argocd/configmap.yaml" +sed -i -E "s|^([[:space:]]*IMAGE_TAG: \")[^\"]*(\")|\\1$NEW_MAIN_VERSION\\2|" "$CONFIGMAP_FILE" + +if ! grep -q "IMAGE_TAG: \"$NEW_MAIN_VERSION\"" "$CONFIGMAP_FILE"; then + echo "Error: Could not update IMAGE_TAG in $CONFIGMAP_FILE" + exit 1 +fi # Copy database cp "$DB_SOURCE" "$DB_DEST" diff --git a/scripts/partial_deploy.sh b/scripts/partial_deploy.sh index 172e6c9..05c7f6d 100755 --- a/scripts/partial_deploy.sh +++ b/scripts/partial_deploy.sh @@ -2,6 +2,7 @@ # Partial deployment script - bumps main container version by 0.001 DEPLOYMENT_FILE="argocd/deployment.yaml" +CONFIGMAP_FILE="argocd/configmap.yaml" # Check if file exists if [ ! -f "$DEPLOYMENT_FILE" ]; then @@ -9,6 +10,11 @@ if [ ! -f "$DEPLOYMENT_FILE" ]; then exit 1 fi +if [ ! -f "$CONFIGMAP_FILE" ]; then + echo "Error: $CONFIGMAP_FILE not found" + exit 1 +fi + # Extract current version of main container (labhelper, not labhelper-data-loader) CURRENT_VERSION=$(grep -E "image: git.baumann.gr/adebaumann/labhelper:[0-9]" "$DEPLOYMENT_FILE" | grep -v "data-loader" | sed -E 's/.*:([0-9.]+)/\1/') @@ -24,7 +30,12 @@ NEW_VERSION=$(echo "$CURRENT_VERSION + 0.001" | bc | sed 's/^\./0./') sed -i "s|image: git.baumann.gr/adebaumann/labhelper:$CURRENT_VERSION|image: git.baumann.gr/adebaumann/labhelper:$NEW_VERSION|" "$DEPLOYMENT_FILE" # Update ConfigMap with new main container version -sed -i "s| IMAGE_TAG: \"$CURRENT_VERSION\"| IMAGE_TAG: \"$NEW_VERSION\"|" "argocd/configmap.yaml" +sed -i -E "s|^([[:space:]]*IMAGE_TAG: \")[^\"]*(\")|\\1$NEW_VERSION\\2|" "$CONFIGMAP_FILE" + +if ! grep -q "IMAGE_TAG: \"$NEW_VERSION\"" "$CONFIGMAP_FILE"; then + echo "Error: Could not update IMAGE_TAG in $CONFIGMAP_FILE" + exit 1 +fi echo "Partial deployment prepared:" echo " Main container: $CURRENT_VERSION -> $NEW_VERSION"