gCubeBuilder/Jenkinsfile_yaml

41 lines
923 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
List jsonConfig = new Yaml().load(text)
jsonConfig.each{println it.subject}
echo "gcube v. ${objejsonConfigct['gCube_version']}"
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
}
}]}
}