Skip to content
Snippets Groups Projects
Commit 9daf85eb authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

create builds.txt artefact also for doocs libraries

parent aa20e48b
No related branches found
No related tags found
No related merge requests found
...@@ -14,19 +14,29 @@ def call(String libraryName, ArrayList<String> dependencyList) { ...@@ -14,19 +14,29 @@ def call(String libraryName, ArrayList<String> dependencyList) {
'bionic-Debug', 'bionic-Debug',
'bionic-Release' ] 'bionic-Release' ]
// publish our list of builds as artefact for our downstream builds
script {
node('Docker') {
writeFile file: "builds.txt", text: builds.join("\n")
archiveArtifacts artifacts: "builds.txt", onlyIfSuccessful: false
}
}
// form comma-separated list of dependencies as needed for the trigger configuration
def dependencies = dependencyList.join(',') def dependencies = dependencyList.join(',')
if(dependencies == "") { if(dependencies == "") {
dependencies = "Create Docker Images" dependencies = "Create Docker Images"
} }
pipeline {
agent none
// setup build trigger // setup build trigger
triggers { triggers {
pollSCM 'H/5 * * * *' pollSCM 'H/5 * * * *'
upstream dependencies upstream dependencies
} }
pipeline {
agent none
stages { stages {
stage('build') { stage('build') {
// Run the build stages for all labels + build types in parallel, each in a separate docker container // Run the build stages for all labels + build types in parallel, each in a separate docker container
......
...@@ -17,22 +17,25 @@ def call(ArrayList<String> dependencyList, String gitUrl='') { ...@@ -17,22 +17,25 @@ def call(ArrayList<String> dependencyList, String gitUrl='') {
// only keep builds which exist for all dependencies // only keep builds which exist for all dependencies
script { script {
dependencyList.each { node('Docker') {
if( it != "" ) { dependencyList.each {
copyArtifacts filter: "builds.txt", fingerprintArtifacts: true, projectName: "${it}", selector: lastSuccessful(), target: "artefacts" if( it != "" ) {
myFile = readFile(env.WORKSPACE+"/artefacts/builds.txt") copyArtifacts filter: "builds.txt", fingerprintArtifacts: true, projectName: "${it}", selector: lastSuccessful(), target: "artefacts"
def depBuilds = myFile.split("\n") myFile = readFile(env.WORKSPACE+"/artefacts/builds.txt")
builds.each { def depBuilds = myFile.split("\n")
if(depBuilds.find { it == owner.it } != it) { builds.each {
builds.removeAll { it == owner.it } def build = it
if(depBuilds.find { it == build } != it) {
builds.removeAll { it == build }
}
} }
} }
} }
}
// publish our list of builds as artefact for our downstream builds // publish our list of builds as artefact for our downstream builds
writeFile("builds.txt", builds.join("\n")) writeFile file: "builds.txt", text: builds.join("\n")
archiveArtifacts artifacts: "builds.txt", onlyIfSuccessful: false archiveArtifacts artifacts: "builds.txt", onlyIfSuccessful: false
}
} }
// form comma-separated list of dependencies as needed for the trigger configuration // form comma-separated list of dependencies as needed for the trigger configuration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment