40 lines
955 B
Plaintext
40 lines
955 B
Plaintext
import org.yaml.snakeyaml.Yaml
|
|
|
|
//locate where this jenkinsfile is
|
|
String releaseURL = "https://code-repo.d4science.org/gCubeCI/gCubeRelease/raw/branch/feature/17273/releases/gcube-4.14.5.yaml"
|
|
//check and parse the release file
|
|
println "Querying ${releaseURL}"
|
|
def text = releaseURL.toURL().getText()
|
|
echo text
|
|
|
|
//parsing
|
|
def jsonConfig = new Yaml().load(text)
|
|
println jsonConfig.inspect()
|
|
echo "gCube v. ${jsonConfig.gCube_release.Version}"
|
|
|
|
echo "components:"
|
|
jsonConfig.gCube_release.Components.each{println it.key}
|
|
|
|
pipeline {
|
|
agent any
|
|
stages {
|
|
stage('build') {
|
|
steps {
|
|
buildComponents items: ("a".."f").collect { "Stage ${it}" }
|
|
}
|
|
}
|
|
stage('build2') {
|
|
steps {
|
|
buildComponents items: ("g".."p").collect { "Stage ${it}" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
def buildComponents(args) {
|
|
parallel args.items.collectEntries { name -> [ "${name}": {
|
|
stage("${name}") {
|
|
echo name
|
|
}
|
|
}]}
|
|
} |