gCubeBuilder/examples/with_function

35 lines
975 B
Plaintext

import groovy.json.JsonSlurper
//locate where this jenkinsfile is
String releaseURL = "https://code-repo.d4science.org/gCubeCI/gCubeRelease/raw/branch/feature/17273/releases/gcube-${params.gCube_release_number}.json"
//check and parse the release file
println "Querying ${releaseURL}"
def text = releaseURL.toURL().getText()
def gcubeJSON = new JsonSlurper().parseText(text)
//check that the release number parameter is the one expected
assert gcubeJSON["gCube.version"] == params.gCube_release_number : "Release versions do not match!"
pipeline {
agent any
stages {
stage('build') {
steps {
buildComponents items: ("a".."f").collect { "Stage ${it}" }
}
}
stage('build2') {
steps {
buildComponents items: ("g".."fp").collect { "Stage ${it}" }
}
}
}
}
def buildComponents(args) {
parallel args.items.collectEntries { name -> [ "${name}": {
stage("${name}") {
echo name
}
}]}
}