Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BXMSPROD-2019] wait for seed job execution #1004

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions dsl/seed/jenkinsfiles/Jenkinsfile.prod.prepare
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,39 @@ pipeline{
script {
println "Updating projects versions"

String jobName = "${getEcosystemProductizedBranch()}/setup-branch/0-setup-branch"
def prodBranch = getEcosystemProductizedBranch()
String jobName = "${prodBranch}/setup-branch/0-setup-branch"
List jobParams = []
jobParams.add(booleanParam(name: 'DEPLOY_ARTIFACTS', value: false))
// here we could have a variable number of params
getProjectUpdateVersionKeys().each{ p ->
jobParams.add(stringParam(name: p.key.replace('_UPDATE', ''), value: p.value))
}

echo "Build ./${jobName} with parameters ${jobParams}"
if (!isDryRun()) {
def job = build(job: "./${jobName}", parameters: jobParams, wait: true, propagate: false)
if (job.result != 'SUCCESS') {
unstable("Update projects version on repositories was not successful")
def job = [:]
try {
// Retry 20 times every 5 min in order to assure seed job ran
retry(20) {
sleep 300
echo "Build ./${jobName} with parameters ${jobParams}"
job = build(job: "./${jobName}", parameters: jobParams, wait: true, propagate: false)
}

if (job.result != 'SUCCESS') {
unstable("Update projects version on repositories was not successful")
}
} catch (err) {
unstable("Error executing the ${prodBranch} setup job ...")
String msg = "ERROR: Setup branch job on newly created release branch '${prodBranch}' was unsuccessful."
if(job) {
msg += "\nPlease review job ${job.absoluteUrl}..."
}
sendNotification(msg)
}
} else {
// dry run - just print the job name and params
echo "Build ./${jobName} with parameters ${jobParams}"
}
}
}
Expand Down