Access to the workspace with readFileFromWorkspace().
This commit is contained in:
parent
3b9ac54814
commit
07b17d6a7f
|
@ -3,19 +3,12 @@ import groovy.io.FileType
|
||||||
|
|
||||||
|
|
||||||
//locate where this jenkinsfile is
|
//locate where this jenkinsfile is
|
||||||
def workspace = SEED_JOB.lastBuild.checkout[0].workspace
|
|
||||||
def releaseConfigDir = "${workspace}/releases"
|
|
||||||
|
|
||||||
def files = []
|
|
||||||
new File(releaseConfigDir).eachFileRecurse (FileType.FILES) { file ->
|
|
||||||
println file.path
|
|
||||||
}
|
|
||||||
|
|
||||||
//check and parse the release file
|
//check and parse the release file
|
||||||
def inputFile = new File("${releaseConfigDir}/gcube-${params.gCube_release_number}.json")
|
def releaseFile = readFileFromWorkspace("gcube-${params.gCube_release_number}.json")
|
||||||
assert inputFile.exists() : "Release file not found (expected gcube-${params.gCube_release_number}.json)"
|
assert releaseFile.exists() : "Release file not found (expected gcube-${params.gCube_release_number}.json)"
|
||||||
assert inputFile.canRead() : "Release file cannot be read"
|
assert releaseFile.canRead() : "Release file cannot be read"
|
||||||
def gcubeJSON = new JsonSlurper().parseText(inputFile)
|
def gcubeJSON = new JsonSlurper().parseText(releaseFile)
|
||||||
|
|
||||||
//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!"
|
||||||
|
|
Loading…
Reference in New Issue