gCubeBuilder/Jenkinsfile_yaml

41 lines
966 B
Plaintext
Raw Normal View History

2019-09-02 17:46:53 +02:00
@Grab('org.yaml:snakeyaml:1.17')
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
2019-09-03 04:49:14 +02:00
def jsonConfig = new Yaml().load(text)
println jsonConfig.inspect()
echo "gCube v. ${jsonConfig.gCube_release}"
2019-09-02 17:46:53 +02:00
2019-09-03 04:49:14 +02:00
jsonConfig.gCube_release.Components.each{println it.subject}
2019-09-02 17:46:53 +02:00
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
}
}]}
}