diff --git a/Jenkinsfile b/Jenkinsfile index 1a4ec21..16f6088 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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)