Locate the jenkinsfile.

This commit is contained in:
Manuele Simi 2019-08-30 06:46:09 -04:00
parent 6951c87314
commit ed187a714c
1 changed files with 6 additions and 2 deletions

8
Jenkinsfile vendored
View File

@ -1,8 +1,12 @@
import groovy.json.JsonSlurper
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 files = []
def dir = new File(".")
dir.eachFileRecurse (FileType.FILES) { file ->
files << file
}
@ -12,7 +16,7 @@ files.each {
}
//check and parse the release file
def inputFile = new File(".\\releases\\gcube-${params.gCube_release_number}.json")
def inputFile = new File("${script_dir}/releases/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)