From 2167f4c9e706fe48866a6e8a5062212790e1e62f Mon Sep 17 00:00:00 2001 From: Chris Park Date: Fri, 27 Oct 2017 14:09:03 -0400 Subject: [PATCH] Jenkinsfiles - updated to look for upstream ALT_URL --- Jenkinsfile | 4 +++- Jenkinsfile.examples | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fd9203c..28b186e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,9 @@ node { checkout scm } stage("Test with Docker") { - withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${env.BINDING_TEST_URL}"]) { + echo "${env.ALT_URL}" + def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}" + withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) { sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosetteapi/docker-nodejs" } } diff --git a/Jenkinsfile.examples b/Jenkinsfile.examples index 5dfcbd5..ad76198 100644 --- a/Jenkinsfile.examples +++ b/Jenkinsfile.examples @@ -15,7 +15,9 @@ node { } } stage("Run Examples") { - withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${env.BINDING_TEST_URL}"]) { + echo "${env.ALT_URL}" + def useUrl = ("${env.ALT_URL}" == "null") ? "${env.BINDING_TEST_URL}" : "${env.ALT_URL}" + withEnv(["API_KEY=${env.ROSETTE_API_KEY}", "ALT_URL=${useUrl}"]) { def examplesDir = "${SOURCEDIR}" + '/examples' sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${examplesDir}:/source ${TEST_CONTAINER}" }