Skip to content

Commit

Permalink
rework CI for helm to merge release and test job #4
Browse files Browse the repository at this point in the history
  • Loading branch information
abychko committed Oct 21, 2024
1 parent 3b41ddf commit bed7cf3
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .jenkins/helm-ci-job.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pipeline {
agent { label 'srcbuild' }
stages {
stage ('Helm Release') {
steps {
echo "Making Helm release from git: " + env.GIT_BRANCH
script{
version = sh(script: "grep appVersion mysql-galera/helm/Chart.yaml | awk '{print \$NF}' | sed -e 's:\"::g'",
returnStdout: true).trim()
env.DIRECTORY = "mysql-galera-" + version + "-" + env.RELEASENUM
env.TARBALL = env.DIRECTORY + ".tar.gz"
}
sh """
set -x
cp -a mysql-galera/helm $DIRECTORY
pushd $directory
./set_values.sh \
--rootpw "@@SET_ME@@" \
--dbuser "@@SET_ME@@" \
--userpw "@@SET_ME@@"
rm -vf values.tmpl set_values.sh
popd
/usr/bin/tar -czf ${TARBALL} ${DIRECTORY}
"""
archiveArtifacts artifacts: $TARBALL
}
}
}
}
36 changes: 36 additions & 0 deletions .jenkins/helm-ci-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- job:
name: helm-ci-job
project-type: pipeline
sandbox: true
properties:
- build-discarder:
num-to-keep: 10
parameters:
- choice:
name: REPOSITORY
choices:
- "codership/mysql-galera-test"
- "codership/mysql-galera"
description: "Devel or public repository"
- string:
name: MYSQL_RPM_VERSION
default: "8.0.39-26.20"
description: "MYSQL RPM version"
- string:
name: RELEASENUM
default: "1"
description: "Package version"
- string:
name: GIT_TARGET
default: "develop"
description: "Branch, Tag or commit hash"
pipeline-scm:
scm:
- git:
url: git@github.com:codership/containers.git
credentials-id: '4767db11-ae93-4aaf-91f9-3b9c728b5249'
branches:
- ${{GIT_TARGET}}
clean: true
script-path: .jenkins/helm-ci-job.groovy
lightweight-checkout: true

0 comments on commit bed7cf3

Please sign in to comment.