Update Jenkinsfile
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good

This commit is contained in:
2025-07-15 11:42:23 +02:00
parent 4633769366
commit d9bcad9f77

18
Jenkinsfile vendored
View File

@@ -94,40 +94,44 @@ pipeline {
) )
]) { ]) {
script { script {
def newTag = "0.${env.BUILD_ID}" def newTag = "0.${env.BUILD_ID}-dev.1"
def chartRepo = "https://${GIT_USER}:${GIT_PAT}@gitea.innovation-hub-niedersachsen.de/innohub/charts.git" def chartRepo = "https://${GIT_USER}:${GIT_PAT}@gitea.innovation-hub-niedersachsen.de/innohub/charts.git"
def chartPath = "tatort-dev/tatort" def chartPath = "tatort-dev/tatort"
def chartDir = "charts-tmp/${chartPath}" def chartDir = "charts-tmp/${chartPath}"
def chartRepoRoot = "charts-tmp/tatort-dev"
sh """ sh """
set -e set -e
echo "[INFO] Cloning chart repo..."
rm -rf charts-tmp rm -rf charts-tmp
git clone ${chartRepo} charts-tmp git clone ${chartRepo} charts-tmp
cd ${chartDir}
echo "[INFO] Updating values.yaml and Chart.yaml..." echo "[INFO] Updating values.yaml and Chart.yaml..."
cd ${chartDir}
sed -i 's|^ repository: .*| repository: gitea.innovation-hub-niedersachsen.de/innohub/tatort-dev|' values.yaml
sed -i 's/^ tag: .*/ tag: ${newTag}/' values.yaml sed -i 's/^ tag: .*/ tag: ${newTag}/' values.yaml
sed -i 's/^version: .*/version: ${newTag}/' Chart.yaml sed -i 's/^version: .*/version: ${newTag}/' Chart.yaml
sed -i 's/^appVersion: .*/appVersion: ${newTag}/' Chart.yaml sed -i 's/^appVersion: .*/appVersion: ${newTag}/' Chart.yaml
echo "[INFO] Removing old chart packages..." echo "[INFO] Cleaning up old chart packages..."
cd .. cd ..
rm -f index.yaml
rm -f tatort-*.tgz rm -f tatort-*.tgz
echo "[INFO] Packaging chart into parent dir..." echo "[INFO] Packaging Helm chart..."
cd tatort cd tatort
helm package . --destination .. helm package . --destination ..
echo "[INFO] Updating index.yaml in parent dir..." echo "[INFO] Updating Helm index.yaml..."
cd .. cd ..
helm repo index . --merge index.yaml || helm repo index . helm repo index . --merge index.yaml || helm repo index .
echo "[INFO] Committing Helm chart changes..." echo "[INFO] Committing and pushing chart changes..."
git config user.name "Jenkins" git config user.name "Jenkins"
git config user.email "jenkins@innohub.local" git config user.email "jenkins@innohub.local"
git add tatort/values.yaml tatort/Chart.yaml tatort-*.tgz index.yaml git add tatort/values.yaml tatort/Chart.yaml tatort-*.tgz index.yaml
git commit -m "ci: bump tatort chart to ${newTag}, package + index" git commit -m "ci: bump tatort-dev to ${newTag}, package chart + update index"
git push origin main git push origin main
""" """
} }