Compare commits
11 Commits
c55dca78f1
...
e1d7dfb658
Author | SHA1 | Date |
---|---|---|
Roberto Cirillo | e1d7dfb658 | |
Roberto Cirillo | 893632abfd | |
Roberto Cirillo | 0267459b51 | |
Roberto Cirillo | bfb77ff024 | |
Roberto Cirillo | eebdae5529 | |
Roberto Cirillo | 15a482bd26 | |
Roberto Cirillo | 84100a10be | |
Roberto Cirillo | 423220f329 | |
Roberto Cirillo | 5d67b4355e | |
Roberto Cirillo | bd23fde2d1 | |
Roberto Cirillo | 517fbb40f0 |
|
@ -1,15 +1,25 @@
|
|||
def agent_root_folder = '/var/lib/jenkins/.m2'
|
||||
def projects2artifacts = [:]
|
||||
def artifacts2projects = [:]
|
||||
def modules2deps = [:]
|
||||
def alreadyInTheTree = []
|
||||
def inputProject = params.jenkins_project.trim()
|
||||
def report = [:]
|
||||
|
||||
report['project'] = inputProject
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label 'CD'
|
||||
}
|
||||
|
||||
environment {
|
||||
AGENT_ROOT_FOLDER = "${agent_root_folder}"
|
||||
PIPELINE_BUILD_NUMBER = "${env.BUILD_NUMBER}"
|
||||
WALKER_NOTES = "${agent_root_folder}/walker_notes.${PIPELINE_BUILD_NUMBER}.txt"
|
||||
}
|
||||
|
||||
|
||||
parameters {
|
||||
string(name: 'jenkins_project',
|
||||
defaultValue: '',
|
||||
|
@ -69,6 +79,33 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
// post-build actions
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
sh '''
|
||||
cp $WALKER_NOTES ./walker_notes.${PIPELINE_BUILD_NUMBER}.md
|
||||
'''
|
||||
}
|
||||
}
|
||||
success {
|
||||
echo 'The dependencies walker pipeline worked!'
|
||||
emailext to: 'jenkinsbuilds@d4science.org',
|
||||
subject: "[Jenkins WalkerPipeline D4S] build ${currentBuild.fullDisplayName} worked",
|
||||
body: "Build time: ${currentBuild.durationString}. See ${env.BUILD_URL}"
|
||||
emailext attachmentsPattern: "**/walker_notes.${PIPELINE_BUILD_NUMBER}.md",
|
||||
to: 'jenkinsreleases@d4science.org',
|
||||
subject: "Dependency Report for gCube component ${inputProject} (build #${PIPELINE_BUILD_NUMBER})",
|
||||
body: "Downstream dependencies of ${inputProject}. See ${env.BUILD_URL}"
|
||||
}
|
||||
failure {
|
||||
echo 'The dependencies walker pipeline has failed'
|
||||
emailext attachLog: true,
|
||||
to: 'jenkinsbuilds@d4science.org',
|
||||
subject: "[JenkinsDependenciesWalker D4S] build ${currentBuild.fullDisplayName} failed for component ${inputProject}",
|
||||
body: "Something is wrong with ${env.BUILD_URL}"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// look for modules that use this artifact
|
||||
|
@ -144,7 +181,16 @@ def printReport(report) {
|
|||
text += "\n"
|
||||
}
|
||||
println text
|
||||
appendNotes(text)
|
||||
|
||||
}
|
||||
|
||||
def appendNotes(report) {
|
||||
sh("""#!/bin/bash
|
||||
echo -e "${report}" > $WALKER_NOTES
|
||||
""")
|
||||
}
|
||||
|
||||
// debug job
|
||||
def printJob(job) {
|
||||
println("fullname ${job.fullName}")
|
||||
|
|
Loading…
Reference in New Issue