Skip to content

Instantly share code, notes, and snippets.

@mathieuancelin
Created February 10, 2012 13:57
Show Gist options
  • Save mathieuancelin/1789777 to your computer and use it in GitHub Desktop.
Save mathieuancelin/1789777 to your computer and use it in GitHub Desktop.
Triggered by Job : root with [:]
Jenkins is running job : Job1 with args : [:]
Jenkins is running job : Job2 with args : [param1:troulala, param2:machin]
Jenkins is running job : Job3 with args : [:]
DONE DONE DONE
Parallel execution {
Jenkins is running job : jobp1 with args : [:]
Jenkins is running job : jobp2 with args : [:]
}
DONE
DONE
Guarded {
Jenkins is running job : jobg1 with args : [:]
Jenkins is running job : willFail with args : [:]
} Rescuing {
Jenkins is running job : Cleaning with args : [:]
}
flow {
println "\nTriggered by ${cause.build}\n"
a = build("Job1")
b = build("Job2", param1: "troulala", param2: "machin")
c = build("Job3")
println "\n${a.result()} ${b.result()} ${c.result()}\n"
par = parallel {
build("jobp1")
build("jobp2")
}
par.values().each { job -> println job.result() }
guard {
build("jobg1")
build("willFail")
} rescue {
build("Cleaning")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment