Early working version of YAML-based pipeline.

This commit is contained in:
Manuele Simi 2019-09-02 23:38:06 -04:00
parent 9758e483fa
commit 20750b77a3
1 changed files with 21 additions and 15 deletions

View File

@ -5,27 +5,35 @@ String releaseURL = "https://code-repo.d4science.org/gCubeCI/gCubeRelease/raw/br
//check and parse the release file //check and parse the release file
println "Querying ${releaseURL}" println "Querying ${releaseURL}"
def text = releaseURL.toURL().getText() def text = releaseURL.toURL().getText()
echo text
//parsing //parsing
def jsonConfig = new Yaml().load(text) def jsonConfig = new Yaml().load(text)
println jsonConfig.inspect() println jsonConfig.inspect()
echo "gCube v. ${jsonConfig.gCube_release.Version}" echo "gCube v. ${jsonConfig.gCube_release.Version}"
echo "Found components:"
echo "components:"
jsonConfig.gCube_release.Components.each{println it.key} jsonConfig.gCube_release.Components.each{println it.key}
pipeline { pipeline {
agent any // see https://jenkins.io/doc/book/pipeline/syntax/#agent
agent {
label 'pipeline-agent'
}
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
stages { stages {
stage('build') { stage('build SmartGears components') {
steps { steps {
buildComponents items: ("a".."f").collect { "Stage ${it}" } buildComponents items: jsonConfig.gCube_release.Components.SmartGears.collect { "${it}" }
} }
} }
stage('build2') { stage('build Enabling components') {
steps { steps {
buildComponents items: ("g".."p").collect { "Stage ${it}" } buildComponents items: jsonConfig.gCube_release.Components.Enabling.collect { "${it}" }
}
}
stage('build Data components') {
steps {
buildComponents items: jsonConfig.gCube_release.Components.Data.collect { "${it}" }
} }
} }
} }
@ -33,8 +41,6 @@ pipeline {
def buildComponents(args) { def buildComponents(args) {
parallel args.items.collectEntries { name -> [ "${name}": { parallel args.items.collectEntries { name -> [ "${name}": {
stage("${name}") { build name
echo name
}
}]} }]}
} }