Update Jenkinsfile
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit

This commit is contained in:
2025-07-15 10:49:51 +02:00
parent 51af112610
commit 73c551c9de

44
Jenkinsfile vendored
View File

@@ -81,38 +81,40 @@ pipeline {
} }
} }
stage('Update helm chart repository') { stage('Update Helm Chart Repository') {
when { when {
branch 'development' branch 'development'
} }
steps { steps {
script { withCredentials([usernamePassword(credentialsId: 'JenkinsGitea', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_PAT')]) {
def newTag = "0.${env.BUILD_ID}" script {
def chartRepo = "https://jenkins:${env.TOKEN}@gitea.innovation-hub-niedersachsen.de/innohub/charts.git" def newTag = "0.${env.BUILD_ID}"
def chartPath = "tatort-dev/tatort" def chartRepo = "https://${GIT_USER}:${GIT_PAT}@gitea.innovation-hub-niedersachsen.de/innohub/charts.git"
def chartPath = "tatort-dev/tatort"
sh """ sh """
rm -rf charts-tmp # Clean clone
git clone ${chartRepo} charts-tmp rm -rf charts-tmp
cd charts-tmp/${chartPath} git clone ${chartRepo} charts-tmp
cd charts-tmp/${chartPath}
# update image tag in values.yaml # Update values.yaml image tag
sed -i 's/^ tag: .*/ tag: ${newTag}/' values.yaml sed -i 's/^ tag: .*/ tag: ${newTag}/' values.yaml
# optional: bump version in Chart.yaml # Optional: bump chart version and appVersion
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
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 values.yaml Chart.yaml git add values.yaml Chart.yaml
git commit -m 'ci: update tatort-dev chart with image tag ${newTag}' git commit -m "ci: update tatort-dev chart with image tag ${newTag}"
git push origin main git push origin main
""" """
}
} }
} }
} }
}
post { post {
success { success {