Append new jobs to the previous job report.
This commit is contained in:
parent
9a21b62ed7
commit
0a173b49c6
|
@ -125,18 +125,33 @@ pipeline {
|
||||||
|
|
||||||
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
|
//see https://jenkins.io/doc/book/pipeline/syntax/#stages
|
||||||
stages {
|
stages {
|
||||||
stage('resume previous build?') {
|
stage('initialize reports') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
if (resume) {
|
if (resume) {
|
||||||
content = readFile("${previous_report_file}")
|
content = readFile("${previous_report_file}")
|
||||||
println "JOB REPORT CONTENT: ${content}"
|
println "JOB REPORT CONTENT: ${content}"
|
||||||
jobs = parseJobs(content)
|
jobs = parseJobs(content)
|
||||||
|
sh "cp ${PREVIOUS_JOB_REPORT} ${JOB_REPORT}"
|
||||||
|
} else {
|
||||||
|
sh "echo #Build ${PIPELINE_BUILD_NUMBER} > ${JOB_REPORT}"
|
||||||
|
sh "echo #StartTime ${date} >> ${JOB_REPORT}"
|
||||||
|
sh "echo -e JobName,Status >> ${JOB_REPORT}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sh '''
|
||||||
|
#build report
|
||||||
|
echo "#Build ${PIPELINE_BUILD_NUMBER}" > ${AGENT_ROOT_FOLDER}/build_commits.csv
|
||||||
|
echo "#Release ${GCUBE_RELEASE_NUMBER}" >> ${AGENT_ROOT_FOLDER}/build_commits.csv
|
||||||
|
date=`date`
|
||||||
|
echo "#StartTime ${date}" >> ${AGENT_ROOT_FOLDER}/build_commits.csv
|
||||||
|
echo -e "GroupID,ArtifactID,Version,SCM URL,Build Number,Distribution URL,Filename,Packaging" >> ${AGENT_ROOT_FOLDER}/build_commits.csv
|
||||||
|
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('initialize') {
|
stage('initialize local repository') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
echo "REMOVE_LOCAL_REPO: ${REMOVE_LOCAL_REPO}"
|
echo "REMOVE_LOCAL_REPO: ${REMOVE_LOCAL_REPO}"
|
||||||
|
@ -154,17 +169,6 @@ pipeline {
|
||||||
cp "${AGENT_ROOT_FOLDER}/${MAVEN_SETTINGS_FILE}" "${AGENT_ROOT_FOLDER}/settings.xml"
|
cp "${AGENT_ROOT_FOLDER}/${MAVEN_SETTINGS_FILE}" "${AGENT_ROOT_FOLDER}/settings.xml"
|
||||||
echo "Done with local repository and settings"
|
echo "Done with local repository and settings"
|
||||||
|
|
||||||
#build report
|
|
||||||
echo "#Build ${PIPELINE_BUILD_NUMBER}" > ${AGENT_ROOT_FOLDER}/build_commits.csv
|
|
||||||
echo "#Release ${GCUBE_RELEASE_NUMBER}" >> ${AGENT_ROOT_FOLDER}/build_commits.csv
|
|
||||||
date=`date`
|
|
||||||
echo "#StartTime ${date}" >> ${AGENT_ROOT_FOLDER}/build_commits.csv
|
|
||||||
echo -e "GroupID,ArtifactID,Version,SCM URL,Build Number,Distribution URL,Filename,Packaging" >> ${AGENT_ROOT_FOLDER}/build_commits.csv
|
|
||||||
|
|
||||||
#job report
|
|
||||||
echo "#Build ${PIPELINE_BUILD_NUMBER}" > ${JOB_REPORT}
|
|
||||||
echo "#StartTime ${date}" >> ${JOB_REPORT}
|
|
||||||
echo -e "JobName,Status" >> ${JOB_REPORT}
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue