Skip to content

Add Jenkinsfiles #23009

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tyler-yankee
Copy link
Contributor

@tyler-yankee tyler-yankee commented May 14, 2025

Towards #22826. Adds .jenkins/ for defining Jenkins job logic in Drake itself, rather than dynamically generating it in job definitions:

  • Adds production, experimental, staging, cache server health check, and external examples pipelines in Jenkinsfiles
  • Adds shared utils in utils/utils.groovy
  • Fixes documentation in jenkins.md for how to use the new experimental jobs

The continuous, nightly, experimental, and pre-merge jobs will all use these files. Experimental and pre-merge jobs will look a little different, but function the same way in terms of providing parameters to run branches/PRs of drake and CI, running automatically on PRs, keeping the "@drake-jenkins-bot ..." comment triggers, etc.


This change is Reviewable

@tyler-yankee
Copy link
Contributor Author

.jenkins/Jenkinsfile line 72 at r1 (raw file):

// Performs the main build step by calling into the drake-ci driver script
// with the necessary credentials and environment variables.
def doBuild(Map scmVars) {

Working: This function needs an additional boolean parameter for staging which defines DRAKE_VERSION as an environment variable, per the existing staging jobs.

@tyler-yankee tyler-yankee marked this pull request as ready for review May 16, 2025 15:22
@tyler-yankee
Copy link
Contributor Author

-(status: do not review) +@BetsyMcPhail for feature review, please.

@tyler-yankee tyler-yankee force-pushed the jenkinsfile branch 11 times, most recently from 42a9e2c to 5597d60 Compare May 22, 2025 14:20
@tyler-yankee tyler-yankee changed the title Add Jenkinsfile definitions Add Jenkinsfiles May 22, 2025
@tyler-yankee
Copy link
Contributor Author

.jenkins/Jenkinsfile-experimental line 61 at r3 (raw file):

// Loads utils by performing a sparse checkout to WORKSPACE/jenkins-utils.
def fetchUtils() {
  def thisBranch = scm.branches[0].name

Working: this is broken for multibranch projects, because it doesn't refer to it with the nice SHA syntax (pr/xxx/head) but a more "display"-ish name (PR-xxx).

@tyler-yankee tyler-yankee force-pushed the jenkinsfile branch 3 times, most recently from 0f0476b to 812e11b Compare May 22, 2025 18:05
@tyler-yankee

This comment was marked as duplicate.

@tyler-yankee
Copy link
Contributor Author

@drake-jenkins-bot linux-jammy-gcc-bazel-experimental-release-multibranchtest2 please

@tyler-yankee
Copy link
Contributor Author

@drake-jenkins-bot linux-jammy-gcc-bazel-experimental-release-test please
@drake-jenkins-bot mac-arm-sonoma-clang-bazel-experimental-release-test please
@drake-jenkins-bot linux-jammy-experimental-cache-server-health-check-test please

@tyler-yankee
Copy link
Contributor Author

tyler-yankee commented May 28, 2025

@drake-jenkins-bot linux-jammy-gcc-bazel-experimental-release please
@drake-jenkins-bot mac-arm-sonoma-clang-bazel-experimental-release please
@drake-jenkins-bot linux-jammy-experimental-cache-server-health-check please

Unfortunately I didn't write in the regex matching with "test", so this comment is going to trigger both the regular experimental jobs and the new test ones. 🤷

Edit: Interestingly, the first one caught the regular job, while the last two caught the test jobs. Possibly a race condition with the plugin? This isn't a regular use-case so I'm not too concerned about it. Good to know that the mac one caught on the first build, so it doesn't have the oddity that the continuous jobs do where you have to run them once manually before the triggers work.

Add Jenkinsfiles for experimental, production, staging, and cache server
health check jobs. Use utils.groovy for shared functionality where
possible (though some common functions still need to be defined in
the pipeline files).
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.

3 participants