From 24443496940b65c8c482c66615326f4586dd09d9 Mon Sep 17 00:00:00 2001 From: Daniel Mann Date: Tue, 15 Jul 2025 11:08:26 +0200 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3148580..14db86b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -86,29 +86,42 @@ pipeline { branch 'development' } steps { - withCredentials([usernamePassword(credentialsId: 'JenkinsGitea', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_PAT')]) { + withCredentials([ + usernamePassword( + credentialsId: 'JenkinsGitea', + usernameVariable: 'GIT_USER', + passwordVariable: 'GIT_PAT' + ) + ]) { script { def newTag = "0.${env.BUILD_ID}" def chartRepo = "https://${GIT_USER}:${GIT_PAT}@gitea.innovation-hub-niedersachsen.de/innohub/charts.git" def chartPath = "tatort-dev/tatort" + def chartDir = "charts-tmp/${chartPath}" sh """ - # Clean clone + set -e + rm -rf charts-tmp git clone ${chartRepo} charts-tmp - cd charts-tmp/${chartPath} + cd ${chartDir} - # Update values.yaml image tag + echo "[INFO] Updating values.yaml and Chart.yaml..." sed -i 's/^ tag: .*/ tag: ${newTag}/' values.yaml - - # Optional: bump chart version and appVersion sed -i 's/^version: .*/version: ${newTag}/' Chart.yaml sed -i 's/^appVersion: .*/appVersion: ${newTag}/' Chart.yaml - git config user.name "jenkins" + echo "[INFO] Packaging chart..." + helm package . + + echo "[INFO] Updating index.yaml..." + helm repo index . --merge index.yaml || helm repo index . + + echo "[INFO] Committing Helm chart changes..." + git config user.name "Jenkins" git config user.email "jenkins@innohub.local" - git add values.yaml Chart.yaml - git commit -m "ci: update tatort-dev chart with image tag ${newTag}" + git add values.yaml Chart.yaml *.tgz index.yaml + git commit -m "ci: bump tatort chart to ${newTag}, package + index" git push origin main """ } @@ -116,7 +129,7 @@ pipeline { } } } - + post { success { script {