mirror of https://github.com/commaai/openpilot.git
parent
331c7b103a
commit
0d5dd25db5
|
@ -9,26 +9,9 @@ def retryWithDelay(int maxRetries, int delay, Closure body) {
|
|||
throw Exception("Failed after ${maxRetries} retries")
|
||||
}
|
||||
|
||||
// check if started by timer: https://stackoverflow.com/questions/43516025/how-to-handle-nightly-build-in-jenkins-declarative-pipeline
|
||||
@NonCPS
|
||||
// check if started by timer: https://gist.github.com/aaclarker/75b8a0eb2b4d600779f84f8e849f2c37
|
||||
def isJobStartedByTimer() {
|
||||
def startedByTimer = false
|
||||
try {
|
||||
def buildCauses = currentBuild.rawBuild.getCauses()
|
||||
for ( buildCause in buildCauses ) {
|
||||
if (buildCause != null) {
|
||||
def causeDescription = buildCause.getShortDescription()
|
||||
echo "shortDescription: ${causeDescription}"
|
||||
if (causeDescription.contains("Started by timer")) {
|
||||
startedByTimer = true
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(theError) {
|
||||
echo "Error getting build cause"
|
||||
}
|
||||
|
||||
return startedByTimer
|
||||
return currentBuild.getBuildCauses()[0]["shortDescription"].matches("Started by timer");
|
||||
}
|
||||
|
||||
def device(String ip, String step_label, String cmd) {
|
||||
|
|
Loading…
Reference in New Issue