Locate the jenkinsfile.
This commit is contained in:
parent
6951c87314
commit
ed187a714c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue