diff --git a/Jenkinsfile b/Jenkinsfile index 053419f0c5..cdf03c330d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -79,19 +79,21 @@ node { } } stage ('minishift tests') { - try { - if (env.CHANGE_ID && pullRequest.labels.contains("skip-openshift-tests")) { - sh script: 'echo "PR identified as not needing Openshift testing."', label: "Skipping Openshift testing stage" - } else { - sh 'make minishift/cleanall || echo' - sh script: "make minishift MINISHIFT_CPUS=\$(nproc --ignore 3) MINISHIFT_MEMORY=24GB MINISHIFT_DISK_SIZE=70GB MINISHIFT_VERSION=${minishift_version} OPENSHIFT_VERSION=${openshift_version}", label: "Making openshift" - sh script: "make -O${SYNC_MAKE_OUTPUT} push-minishift -j5", label: "Pushing built images into openshift" - sh script: "make -O${SYNC_MAKE_OUTPUT} openshift-tests -j1", label: "Making openshift tests" + withCredentials([string(credentialsId: 'github_api_public_read', variable: 'MINISHIFT_GITHUB_API_TOKEN')]) { + try { + if (env.CHANGE_ID && pullRequest.labels.contains("skip-openshift-tests")) { + sh script: 'echo "PR identified as not needing Openshift testing."', label: "Skipping Openshift testing stage" + } else { + sh 'make minishift/cleanall || echo' + sh script: "make minishift MINISHIFT_GITHUB_API_TOKEN=$MINISHIFT_GITHUB_API_TOKEN MINISHIFT_CPUS=\$(nproc --ignore 3) MINISHIFT_MEMORY=24GB MINISHIFT_DISK_SIZE=70GB MINISHIFT_VERSION=${minishift_version} OPENSHIFT_VERSION=${openshift_version}", label: "Making openshift" + sh script: "make -O${SYNC_MAKE_OUTPUT} push-minishift -j5", label: "Pushing built images into openshift" + sh script: "make -O${SYNC_MAKE_OUTPUT} openshift-tests -j1", label: "Making openshift tests" + } + } catch (e) { + echo "Something went wrong, trying to cleanup" + cleanup() + throw e } - } catch (e) { - echo "Something went wrong, trying to cleanup" - cleanup() - throw e } } stage ('cleanup') {