Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci) make sure tags dont get built by the nightly cron #5594

Merged
merged 2 commits into from Feb 25, 2020

Conversation

hutchic
Copy link
Contributor

@hutchic hutchic commented Feb 21, 2020

There's only two conditions in which Jenkins should be doing anything

Release:

  • run from SCM don't run from cron

Nightly Release:

  • run from timer don't run from SCM
  • only run on master and next

SCM push to next / master is a noop
Capture

cron event runs build, test and nightly release stages
Capture2

SCM tag runs build, test and nightly release stage also the tag doesn't attempt to re-run every 24hrs
Capture3

@@ -1,17 +1,35 @@
pipeline {
agent none
triggers {
cron(env.BRANCH_NAME == 'master' | env.BRANCH_NAME == 'next' ? '@daily' : '')
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may need to cherry-pick and push this line onto the 2.x tags

anyOf { branch 'master'; branch 'next' }
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this evaluates to

if (
  ( buildingtag && not cron ) ||
  ( ( branch = master || branch = next) && cron )
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put that in a comment on the file, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in f4485bb

Copy link
Member

@kikito kikito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with one minor request

anyOf { branch 'master'; branch 'next' }
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put that in a comment on the file, too.

@hutchic hutchic merged commit a19f6d9 into master Feb 25, 2020
@hutchic hutchic deleted the chore/ci-cron branch February 25, 2020 17:32
hutchic added a commit that referenced this pull request Feb 27, 2020
* chore(ci) make sure tags dont get built by the nightly cron

* chore(doc) add a comment about the Jenkinsfile when logic
hutchic added a commit that referenced this pull request Feb 27, 2020
* chore(ci) make sure tags dont get built by the nightly cron

* chore(doc) add a comment about the Jenkinsfile when logic
snt8amr pushed a commit to snt8amr/kong that referenced this pull request May 30, 2020
* chore(ci) make sure tags dont get built by the nightly cron

* chore(doc) add a comment about the Jenkinsfile when logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants