Access release files through the WORKSPACE variable.
This commit is contained in:
parent
ed187a714c
commit
403f80cd27
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue