ci: replace inline dsl: script by Groovy files

Jenkins Jobs Builder does not like the inline `dsl:` scripts anymore, so
replace them by Groovy files in the main directory, similar to other
jobs.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2024-01-31 09:52:31 +01:00 committed by Niels de Vos
parent 6e38694a11
commit 9273955d92
5 changed files with 48 additions and 36 deletions

16
jjb-deploy.groovy Normal file
View File

@ -0,0 +1,16 @@
node {
stage('build-images') {
parallel jjb: {
sh "oc start-build --follow jjb"
},
mirror_images: {
sh 'oc start-build --follow mirror-images'
}
}
stage('checkout ci repository') {
git url: "${GIT_REPO}", branch: "${GIT_BRANCH}", changelog: false
}
stage('deployment') {
sh "./deploy/jjb.sh --cmd deploy --GIT_REF ${GIT_BRANCH} --GIT_REPO ${GIT_REPO}"
}
}

14
jjb-validate.groovy Normal file
View File

@ -0,0 +1,14 @@
if (params.ghprbPullId != null) {
GIT_BRANCH = "pull/${ghprbPullId}/merge"
}
node {
stage('checkout ci repository') {
checkout([$class: 'GitSCM', branches: [[name: 'FETCH_HEAD']],
userRemoteConfigs: [[url: "${GIT_REPO}",
refspec: "${GIT_BRANCH}"]]])
}
stage('validation') {
sh "./deploy/jjb.sh --cmd validate --GIT_REF ${GIT_BRANCH} --GIT_REPO ${GIT_REPO}"
}
}

View File

@ -15,9 +15,9 @@
git: git:
url: https://github.com/ceph/ceph-csi url: https://github.com/ceph/ceph-csi
branches: branches:
- ci/devel - ci/centos
script-path: build-images.groovy script-path: build-images.groovy
lightweight-checkout: true lightweight-checkout: false
scm: scm:
- git: - git:
name: origin name: origin

View File

@ -18,24 +18,14 @@
- build-discarder: - build-discarder:
days-to-keep: 7 days-to-keep: 7
artifact-days-to-keep: 7 artifact-days-to-keep: 7
dsl: | pipeline-scm:
node { scm:
stage('build-images') { git:
parallel jjb: { url: https://github.com/ceph/ceph-csi
sh "oc start-build --follow jjb" branches:
}, - ci/centos
mirror_images: { script-path: jjb-deploy.groovy
sh 'oc start-build --follow mirror-images' lightweight-checkout: false
}
}
stage('checkout ci repository') {
git url: "${GIT_REPO}", branch: "${GIT_BRANCH}", changelog: false
}
stage('deployment') {
sh "./deploy/jjb.sh --cmd deploy \
--GIT_REF ${GIT_BRANCH} --GIT_REPO ${GIT_REPO}"
}
}
scm: scm:
- git: - git:
name: origin name: origin

View File

@ -18,22 +18,14 @@
- build-discarder: - build-discarder:
days-to-keep: 7 days-to-keep: 7
artifact-days-to-keep: 7 artifact-days-to-keep: 7
dsl: | pipeline-scm:
if (params.ghprbPullId != null) { scm:
GIT_BRANCH = "pull/${ghprbPullId}/merge" git:
} url: https://github.com/ceph/ceph-csi
branches:
node { - ci/centos
stage('checkout ci repository') { script-path: jjb-validate.groovy
checkout([$class: 'GitSCM', branches: [[name: 'FETCH_HEAD']], lightweight-checkout: false
userRemoteConfigs: [[url: "${GIT_REPO}",
refspec: "${GIT_BRANCH}"]]])
}
stage('validation') {
sh "./deploy/jjb.sh --cmd validate \
--GIT_REF ${GIT_BRANCH} --GIT_REPO ${GIT_REPO}"
}
}
triggers: triggers:
- github-pull-request: - github-pull-request:
status-url: ${RUN_DISPLAY_URL} status-url: ${RUN_DISPLAY_URL}