Create Jobs
The Create Jobs job is used to populate the jenkins subfolders with the jobs defined in JenkinsJobs groovy files. There are 2 Process Job DSLs steps, the first looks for FOLDER.groovy files and creates the folders, the second creates the jobs themselves.
Create Jobs must be run manually. Unfortunately JobDSL needs to be run by a specific user, so the build cannot be automatically started by a timer or when it detects jenkins changes without installing an additional plugin like Authorize Project) which supposedly still works but is abandoned and I (Sam) have not had time to investigate further or find alternatives. This means that while any committer can make changes to the Jenkins Jobs in git, someone with Jenkins rights will have to start the build to implement those changes.
Obsolete jobs have to be deleted manually. They are not deleted automatically as some may be are still in use for a short time (e.g. Y-builds if a java-release is imminent) or to serve as reference in case the new jobs have problems.
The JenkinsJobs Folder
As a general rule, the JenkinsJobs folder should match the layout of Jenkins itself.
Every subfolder should contain one .jenkinsfile per individual pipeline.
Note: JobDSL does also support the creation of Views, so those can be added at some point but someone will either have to manually keep them up to date with the desired jobs or write a script to keep them up-to-date.
Many jobs have the release version in the job name because it is required for results parsing (i.e. the automated tests). In order to minimize manual labor the currently active streams are listed in the buildConfigurations.json file. Version dependent jobs then parse this file during creation and make a job for each stream.
New Jobs
Adding a job to Jenkins should be as easy as adding a new groovy file to git, but here are some general pointers.
- No dashes in filenames, it breaks JobDSL. If there was a
-in the job name I changed it to_in the file name. - Job Names
- No spaces, this is just for the good of scripts etc. The job NAME is used in the url, but you can always add a
displayNamefield if you want the job to appear with a more natural looking name on the page. See (Releng/deployToMaven)[JenkinsJobs/Releng/FOLDER.groovy] as an example. - The folder needs to be part of the job name, otherwise Jenkins will just create the job at the dashboard level.
- No spaces, this is just for the good of scripts etc. The job NAME is used in the url, but you can always add a
- job vs pipelineJob
- Anything that can build on a regular jenkins node or via an available lable uses the job template.
- Anything that defines its own kubernetes pod needs to be a pipelineJob
- Script Formatting You can use
'''triple apostrophes'''to define multiline scripts. I've found it's best to start the script on the same line and not the next, otherwise you end up with blank space at the top of the script step in Jenkins which can break the build (like the arm64 smoke tests). - To see what plugins are installed and what methods are available in the Releng Jenkins you can consult the api viewer.
Every 6 months there is a new Java release which requires additional builds and testing. The java release usually corresponds to odd numbered streams so a new java version would be tested in additional builds run during the 4.25 stream and then included in the 4.26 release I-builds.
The Y-build is a full sdk build with the new java version for testing.
The P-build is a patch build that contains modified plugins designed to be installed on top of the current I-build to test the new java version. They are now managed by the JDT-project itself in org.eclipse.jdt.releng.
The builds themselves and their unit tests are in the build.jenkinsfile in GitHub and the Y Builds folder in jenkins.
When the JDT team is ready they will raise an issue to create new Y builds and supply the name of the new branch, usually BETA_JAVA##.
Things to Do:
- Update the Y-build configuration in the (buildConfigurations.json)[JenkinsJobs/buildConfigurations.json]
- Update
typeNameto the name of the new java version. - Remove the disablement of the current stream in the Y-build configuration (should be the only Y-build stream).
- Update
branchesto point to the new BETA branch. - Add unit tests for the new java version and remove old ones.
- Update