Parse the release file from the server.

This commit is contained in:
Manuele Simi 2019-08-30 22:37:25 -04:00
parent 4f3c9156b7
commit ca59799284
1 changed files with 5 additions and 9 deletions

14
Jenkinsfile vendored
View File

@ -1,17 +1,13 @@
import groovy.json.JsonSlurper import groovy.json.JsonSlurper
import groovy.io.FileType import groovy.io.FileType
def env = System.getenv()
env.each{
println it
}
//locate where this jenkinsfile is //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 //check and parse the release file
def releaseFile = readFile("releases/gcube-${params.gCube_release_number}.json") println "Querying ${releaseURL}"
assert releaseFile.exists() : "Release file not found (expected gcube-${params.gCube_release_number}.json)" def text = releaseURL.toURL().getText()
assert releaseFile.canRead() : "Release file cannot be read" def gcubeJSON = new JsonSlurper().parse
def gcubeJSON = new JsonSlurper().parseText(releaseFile) println gcubeJSON
//check that the release number parameter is the one expected //check that the release number parameter is the one expected
assert gcubeJSON["gCube.version"] == params.gCube_release_number : "Release versions do not match!" assert gcubeJSON["gCube.version"] == params.gCube_release_number : "Release versions do not match!"