Add more checks on the release file.

This commit is contained in:
Manuele Simi 2019-08-29 16:55:38 -04:00
parent 0e2df958e1
commit 17494d8574
1 changed files with 7 additions and 3 deletions

10
Jenkinsfile vendored
View File

@ -1,7 +1,11 @@
import groovy.json.JsonSlurper
//check and parse the release file
def inputFile = new File(".\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)
//check that the release number parameter is the one expected
assert gcubeJSON["gCube.version"] == params.gCube_release_number : "Release versions do not match!"
@ -47,13 +51,13 @@ echo "Use settings file at ${maven_settings_file}"
echo "Use local repo at ${maven_local_repo_path}"
echo "Release number: ${params.gCube_release_number}"
def apps = gcubeJSON['Components']
def components = gcubeJSON['Components']
def dynamicStages = [:]
//let's build the stages closures
apps.each { entry -> echo "App name: $entry.key = Jobs: $entry.value" }
apps.each { entry ->
components.each { entry -> echo "App name: $entry.key = Jobs: $entry.value" }
components.each { entry ->
def app = entry.key
dynamicStages["stage-${app}"] = ["${app}":{
node {