Image tag corrected
All checks were successful
Build containers when image tags change / build-if-image-changed (., web, containers, main container, git.baumann.gr/adebaumann/labhelper) (push) Successful in 36s
Build containers when image tags change / build-if-image-changed (data-loader, loader, initContainers, init-container, git.baumann.gr/adebaumann/labhelper-data-loader) (push) Successful in 9s

This commit is contained in:
2026-05-19 01:27:15 +02:00
parent f4e9cea73b
commit df392f7b7f
4 changed files with 26 additions and 4 deletions

View File

@@ -21,4 +21,4 @@ data:
LOGOUT_REDIRECT_URL: "/login/" LOGOUT_REDIRECT_URL: "/login/"
OIDC_AUTHENTICATION_FAILURE_REDIRECT_URL: "/login/" OIDC_AUTHENTICATION_FAILURE_REDIRECT_URL: "/login/"
GUNICORN_OPTS: "--access-logfile -" GUNICORN_OPTS: "--access-logfile -"
IMAGE_TAG: "0.079" IMAGE_TAG: "0.086"

View File

@@ -27,7 +27,7 @@ spec:
mountPath: /data mountPath: /data
containers: containers:
- name: web - name: web
image: git.baumann.gr/adebaumann/labhelper:0.084 image: git.baumann.gr/adebaumann/labhelper:0.086
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- containerPort: 8000 - containerPort: 8000

View File

@@ -2,6 +2,7 @@
# Full deployment script - bumps both container versions by 0.001 and copies database # Full deployment script - bumps both container versions by 0.001 and copies database
DEPLOYMENT_FILE="argocd/deployment.yaml" DEPLOYMENT_FILE="argocd/deployment.yaml"
CONFIGMAP_FILE="argocd/configmap.yaml"
DB_SOURCE="data/db.sqlite3" DB_SOURCE="data/db.sqlite3"
DB_DEST="data-loader/preload.sqlite3" DB_DEST="data-loader/preload.sqlite3"
@@ -11,6 +12,11 @@ if [ ! -f "$DEPLOYMENT_FILE" ]; then
exit 1 exit 1
fi fi
if [ ! -f "$CONFIGMAP_FILE" ]; then
echo "Error: $CONFIGMAP_FILE not found"
exit 1
fi
# Check if source database exists # Check if source database exists
if [ ! -f "$DB_SOURCE" ]; then if [ ! -f "$DB_SOURCE" ]; then
echo "Error: $DB_SOURCE not found" 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" 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 # 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 # Copy database
cp "$DB_SOURCE" "$DB_DEST" cp "$DB_SOURCE" "$DB_DEST"

View File

@@ -2,6 +2,7 @@
# Partial deployment script - bumps main container version by 0.001 # Partial deployment script - bumps main container version by 0.001
DEPLOYMENT_FILE="argocd/deployment.yaml" DEPLOYMENT_FILE="argocd/deployment.yaml"
CONFIGMAP_FILE="argocd/configmap.yaml"
# Check if file exists # Check if file exists
if [ ! -f "$DEPLOYMENT_FILE" ]; then if [ ! -f "$DEPLOYMENT_FILE" ]; then
@@ -9,6 +10,11 @@ if [ ! -f "$DEPLOYMENT_FILE" ]; then
exit 1 exit 1
fi 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) # 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/') 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" 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 # 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 "Partial deployment prepared:"
echo " Main container: $CURRENT_VERSION -> $NEW_VERSION" echo " Main container: $CURRENT_VERSION -> $NEW_VERSION"