ci: run the nightly test only on the main branch
Currently, all PRs trigger the daily nightly testing. Let's limit that to just the main branch. I found this here: https://stackoverflow.com/questions/39168861/build-periodically-with-a-multi-branch-pipeline-in-jenkins Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
8760de26de
commit
2b823b97ad
1 changed files with 4 additions and 2 deletions
6
schutzbot/Jenkinsfile
vendored
6
schutzbot/Jenkinsfile
vendored
|
|
@ -1,8 +1,10 @@
|
|||
var cron_string = BRANCH_NAME == "main" ? "@daily" : ""
|
||||
|
||||
pipeline {
|
||||
agent none
|
||||
|
||||
triggers {
|
||||
cron('@daily')
|
||||
cron(cron_string)
|
||||
}
|
||||
|
||||
environment {
|
||||
|
|
@ -816,7 +818,7 @@ void preserve_logs(test_slug) {
|
|||
void detect_build_cause() {
|
||||
def buildCause = currentBuild.getBuildCauses().get(0)
|
||||
|
||||
if ( buildCause.shortDescription == 'Started by timer') {
|
||||
if ( buildCause.shortDescription == 'Started by timer' && env.BRANCH_NAME == 'main') {
|
||||
return "cron"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue