ci: use parameters set by github-pull-request-builder

The parameters are set in the environment. It seems the best way to
check if the parameters are available, is with `params.<arg> == null`.

See-also: https://www.jenkins.io/doc/book/pipeline/getting-started/#global-variable-reference#
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2020-05-25 16:00:03 +02:00
parent acb7727c24
commit 8259fe953f
2 changed files with 2 additions and 6 deletions

View File

@ -30,7 +30,7 @@ node('cico-workspace') {
try { try {
stage('prepare bare-metal machine') { stage('prepare bare-metal machine') {
if ("${ghprbPullId}".length() != 0) { if (params.ghprbPullId != null) {
ref = "pull/${ghprbPullId}/head" ref = "pull/${ghprbPullId}/head"
} }
sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh root@${CICO_NODE}:' sh 'scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ./prepare.sh root@${CICO_NODE}:'
@ -42,7 +42,7 @@ node('cico-workspace') {
sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} "cd /opt/build/go/src/github.com/ceph/ceph-csi && make containerized-test CONTAINER_CMD=podman"' sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} "cd /opt/build/go/src/github.com/ceph/ceph-csi && make containerized-test CONTAINER_CMD=podman"'
} }
}, },
build: { build: {
node('cico-workspace') { node('cico-workspace') {
sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} "cd /opt/build/go/src/github.com/ceph/ceph-csi && make containerized-build CONTAINER_CMD=podman"' sh 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${CICO_NODE} "cd /opt/build/go/src/github.com/ceph/ceph-csi && make containerized-build CONTAINER_CMD=podman"'
} }

View File

@ -18,10 +18,6 @@
- ci/centos - ci/centos
script-path: containerized-tests.groovy script-path: containerized-tests.groovy
lightweight-checkout: true lightweight-checkout: true
parameters:
- string:
name: ghprbPullId
default: ''
triggers: triggers:
- github-pull-request: - github-pull-request:
status-context: ci/centos/containerized-tests status-context: ci/centos/containerized-tests