ceph-csi/jobs/build-images.yaml
Niels de Vos 9c4009bd14 ci: pass BASE_IMAGE to "oc start-build"
Because the parallel steps, the build.env is not in the local directory
where the command is executed. So fetch the BASE_IMAGE before continuing
with 'oc start-build', and pass the name of the image on the
commandline.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
2020-11-04 04:28:28 +00:00

50 lines
1.5 KiB
YAML

---
- job:
name: build-images
description: Build container images from the master branch.
project-type: pipeline
concurrent: false
properties:
- github:
url: https://github.com/ceph/ceph-csi
- build-discarder:
days-to-keep: 7
artifact-days-to-keep: 7
# yamllint disable rule:line-length
dsl: |
def GIT_REPO = 'http://github.com/ceph/ceph-csi'
def GIT_BRANCH = 'master'
node {
stage('checkout repository') {
git url: "${GIT_REPO}", branch: "${GIT_BRANCH}", changelog: false
}
stage('build images') {
def base_image = sh(script: 'source ${WORKSPACE}/build.env && echo ${BASE_IMAGE}',
returnStdout: true).trim()
parallel canary: {
sh "oc start-build --follow \
--build-arg=BASE_IMAGE='${base_image}' \
--build-arg=GO_ARCH=amd64 \
ceph-csi-canary"
},
test: {
sh 'oc start-build --follow ceph-csi-test'
},
devel: {
sh "oc start-build --follow \
--build-arg=BASE_IMAGE='${base_image}' \
ceph-csi-devel"
}
}
}
# yamllint enable rule:line-length
scm:
- git:
name: origin
url: https://github.com/ceph/ceph-csi
branches:
- master
triggers:
- pollscm:
cron: "H/5 * * * *"