Skip to content

Commit

Permalink
Avoid rebuilding tags and PRs daily (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
dduportal authored Oct 15, 2024
1 parent dc67330 commit ffb3bf4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env groovy

// Do not rebuild daily if not on the principal branch (e.g. not on PR, not on other branches, not on tags)
String cronPattern = env.BRANCH_IS_PRIMARY ? '@daily' : ''

pipeline {
agent {
// 'docker' is the (legacy) label used on ci.jenkins.io for "Docker Linux AMD64" while 'linux-amd64-docker' is the label used on infra.ci.jenkins.io
Expand All @@ -11,7 +14,7 @@ pipeline {
timestamps()
}
triggers {
cron('@daily')
cron(cronPattern)
}

stages {
Expand Down

0 comments on commit ffb3bf4

Please sign in to comment.