From ca59799284e888910e24ec1e8890454167df0c89 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Fri, 30 Aug 2019 22:37:25 -0400 Subject: [PATCH] Parse the release file from the server. --- Jenkinsfile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 678cbea..7baa54a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,13 @@ import groovy.json.JsonSlurper import groovy.io.FileType -def env = System.getenv() -env.each{ -println it -} //locate where this jenkinsfile is - +String releaseURL = "https://code-repo.d4science.org/gCubeCI/gCubeRelease/raw/commit/4f3c9156b71d42b437605d8431d4dc81fedb31c8/releases/gcube-${params.gCube_release_number}.json.json" //check and parse the release file -def releaseFile = readFile("releases/gcube-${params.gCube_release_number}.json") -assert releaseFile.exists() : "Release file not found (expected gcube-${params.gCube_release_number}.json)" -assert releaseFile.canRead() : "Release file cannot be read" -def gcubeJSON = new JsonSlurper().parseText(releaseFile) +println "Querying ${releaseURL}" +def text = releaseURL.toURL().getText() +def gcubeJSON = new JsonSlurper().parse +println gcubeJSON //check that the release number parameter is the one expected assert gcubeJSON["gCube.version"] == params.gCube_release_number : "Release versions do not match!"