Update Jenkinsfile
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
All checks were successful
InnoHub Processor/tatort/pipeline/head This commit looks good
This commit is contained in:
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@@ -94,40 +94,44 @@ pipeline {
|
||||
)
|
||||
]) {
|
||||
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 chartPath = "tatort-dev/tatort"
|
||||
def chartDir = "charts-tmp/${chartPath}"
|
||||
def chartRepoRoot = "charts-tmp/tatort-dev"
|
||||
|
||||
sh """
|
||||
set -e
|
||||
|
||||
echo "[INFO] Cloning chart repo..."
|
||||
rm -rf charts-tmp
|
||||
git clone ${chartRepo} charts-tmp
|
||||
cd ${chartDir}
|
||||
|
||||
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/^version: .*/version: ${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 ..
|
||||
rm -f index.yaml
|
||||
rm -f tatort-*.tgz
|
||||
|
||||
echo "[INFO] Packaging chart into parent dir..."
|
||||
echo "[INFO] Packaging Helm chart..."
|
||||
cd tatort
|
||||
helm package . --destination ..
|
||||
|
||||
echo "[INFO] Updating index.yaml in parent dir..."
|
||||
echo "[INFO] Updating Helm index.yaml..."
|
||||
cd ..
|
||||
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.email "jenkins@innohub.local"
|
||||
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
|
||||
"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user