How to add Jenkins jobs for images
Procedure
-
Open Jenkins - New Item
-
Enter "Enter an item name" and "Copy from"
Click "OK" after entering.
Then the Job will be created. -
Enter various setting values
Click "Apply" after entering.
The jobs that should be registered
It should be noted that multiple job registrations may be required for a single repository.
The steps 1 through 3 must be repeated for each job.
-
Example 1: Job for Jenkinsfile script
- Works when submitting (merging) to the main branch
- Publishes Docker images and artifacts (documentation and API schema) to the NZ registry
- Using the repository name as the "item name" makes it easier to understand.
-
Example 2: Job for jenkinsAutoVerifier.groovy script
- Build verification is automatically performed when committing or pushing to gerrit.
- No artifacts are pushed.
- Using the repository name with "-auto-verifier" appended as the "item name" makes it easier to understand.
Important settings
-
Build Triggers > Gerrit event > Gerrit Trigger (For jenkinsAutoVerifier.groovy job)
- Trigger on: Patchset Created (This is required to detect patch updates and run jobs.)
- Gerrit Project: (Since the content from "Copy from" is included, the correct value must be entered.)
-
Pipeline > SCM > Repositories
- Repository URL: (Since the content from "Copy from" is included, the correct value must be entered.)
- Repository browser > URL: (Since the content from "Copy from" is included, the correct value must be entered.)
- Script Path: (Specify a script such as Jenkinsfile or jenkinsAutoVerifier.groovy, etc. )