#!/bin/bash # Partial deployment script - bumps main container version by 0.001 DEPLOYMENT_FILE="argocd/deployment.yaml" # Check if file exists if [ ! -f "$DEPLOYMENT_FILE" ]; then echo "Error: $DEPLOYMENT_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/') if [ -z "$CURRENT_VERSION" ]; then echo "Error: Could not find current version" exit 1 fi # Calculate new version (add 0.001), preserve leading zero NEW_VERSION=$(echo "$CURRENT_VERSION + 0.001" | bc | sed 's/^\./0./') # Update the deployment file (only the main container, not the data-loader) 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" echo "Partial deployment prepared:" echo " Main container: $CURRENT_VERSION -> $NEW_VERSION" echo " ConfigMap IMAGE_TAG: $CURRENT_VERSION -> $NEW_VERSION"