2019-09-02 17:46:53 +02:00
|
|
|
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()
|
|
|
|
|
|
|
|
//parsing
|
2019-09-03 04:49:14 +02:00
|
|
|
def jsonConfig = new Yaml().load(text)
|
|
|
|
println jsonConfig.inspect()
|
2019-09-03 05:28:32 +02:00
|
|
|
echo "gCube v. ${jsonConfig.gCube_release.Version}"
|
2019-09-03 05:38:06 +02:00
|
|
|
echo "Found components:"
|
2019-09-03 05:28:32 +02:00
|
|
|
jsonConfig.gCube_release.Components.each{println it.key}
|
2019-09-02 17:46:53 +02:00
|
|
|
|
|
|
|
pipeline {
|
2019-09-03 05:38:06 +02:00
|
|
|
// see https://jenkins.io/doc/book/pipeline/syntax/#agent
|
|
|
|
agent {
|
|
|
|
label 'pipeline-agent'
|
2019-09-02 17:46:53 +02:00
|
|
|
}
|
2019-09-03 05:38:06 +02:00
|
|
|
|
|
|
|
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
|
|
|
|
stages {
|
|
|
|
stage('build SmartGears components') {
|
2019-09-02 17:46:53 +02:00
|
|
|
steps {
|
2019-09-03 05:38:06 +02:00
|
|
|
buildComponents items: jsonConfig.gCube_release.Components.SmartGears.collect { "${it}" }
|
2019-09-02 17:46:53 +02:00
|
|
|
}
|
|
|
|
}
|
2019-09-03 05:38:06 +02:00
|
|
|
stage('build Enabling components') {
|
|
|
|
steps {
|
|
|
|
buildComponents items: jsonConfig.gCube_release.Components.Enabling.collect { "${it}" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('build Data components') {
|
|
|
|
steps {
|
|
|
|
buildComponents items: jsonConfig.gCube_release.Components.Data.collect { "${it}" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-02 17:46:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
def buildComponents(args) {
|
|
|
|
parallel args.items.collectEntries { name -> [ "${name}": {
|
2019-09-03 05:38:06 +02:00
|
|
|
build name
|
2019-09-02 17:46:53 +02:00
|
|
|
}]}
|
|
|
|
}
|