ci: block Jenkins replay (#34196)

* test

* not replay

* up

* text

* text

* fix

* no

* commit

* clean
pull/34202/head
Maxime Desroches 5 months ago committed by GitHub
parent 334e06c04f
commit 41b5065499
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      Jenkinsfile

9
Jenkinsfile vendored

@ -79,6 +79,10 @@ def deviceStage(String stageName, String deviceType, List extra_env, def steps)
return
}
if (isReplay()) {
error("REPLAYING TESTS IS NOT ALLOWED. FIX THEM INSTEAD.")
}
def extra = extra_env.collect { "export ${it}" }.join('\n');
def branch = env.BRANCH_NAME ?: 'master';
def gitDiff = sh returnStdout: true, script: 'curl -s -H "Authorization: Bearer ${GITHUB_COMMENTS_TOKEN}" https://api.github.com/repos/commaai/openpilot/compare/master...${GIT_BRANCH} | jq .files[].filename || echo "/"', label: 'Getting changes'
@ -123,6 +127,11 @@ def hasPathChanged(String gitDiff, List<String> paths) {
return false
}
def isReplay() {
def replayClass = "org.jenkinsci.plugins.workflow.cps.replay.ReplayCause"
return currentBuild.rawBuild.getCauses().any{ cause -> cause.toString().contains(replayClass) }
}
def setupCredentials() {
withCredentials([
string(credentialsId: 'azure_token', variable: 'AZURE_TOKEN'),

Loading…
Cancel
Save