From 8259fe953fda95990c2139a43aae4db448a4a37e Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 25 May 2020 16:00:03 +0200 Subject: [PATCH] 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. == null`. See-also: https://www.jenkins.io/doc/book/pipeline/getting-started/#global-variable-reference# Signed-off-by: Niels de Vos --- containerized-tests.groovy | 4 ++-- containerized-tests.yaml | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/containerized-tests.groovy b/containerized-tests.groovy index cb03545a1..820ed9621 100644 --- a/containerized-tests.groovy +++ b/containerized-tests.groovy @@ -30,7 +30,7 @@ node('cico-workspace') { try { stage('prepare bare-metal machine') { - if ("${ghprbPullId}".length() != 0) { + if (params.ghprbPullId != null) { ref = "pull/${ghprbPullId}/head" } 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"' } }, - build: { + build: { 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"' } diff --git a/containerized-tests.yaml b/containerized-tests.yaml index 4bf4ed584..72ac7ce50 100644 --- a/containerized-tests.yaml +++ b/containerized-tests.yaml @@ -18,10 +18,6 @@ - ci/centos script-path: containerized-tests.groovy lightweight-checkout: true - parameters: - - string: - name: ghprbPullId - default: '' triggers: - github-pull-request: status-context: ci/centos/containerized-tests