Access release files through the WORKSPACE variable.

This commit is contained in:
Manuele Simi 2019-08-30 15:06:34 -04:00
parent ed187a714c
commit 403f80cd27
1 changed files with 4 additions and 9 deletions

13
Jenkinsfile vendored
View File

@ -3,20 +3,15 @@ import groovy.io.FileType
//locate where this jenkinsfile is
def script_dir = new File(getClass().protectionDomain.codeSource.location.path).parent
def dir = new File("${script_dir}")
def releaseConfigDir = "${env.WORKSPACE}/releases"
def files = []
dir.eachFileRecurse (FileType.FILES) { file ->
files << file
}
files.each {
println it.path
new File(releaseConfigDir).eachFileRecurse (FileType.FILES) { file ->
println file.path
}
//check and parse the release file
def inputFile = new File("${script_dir}/releases/gcube-${params.gCube_release_number}.json")
def inputFile = new File("${releaseConfigDir}/gcube-${params.gCube_release_number}.json")
assert inputFile.exists() : "Release file not found (expected gcube-${params.gCube_release_number}.json)"
assert inputFile.canRead() : "Release file cannot be read"
def gcubeJSON = new JsonSlurper().parseText(inputFile)