|
| 1 | +--- |
| 2 | +# This YAML configuration defines a pipeline for automatically updating the Jenkins Weekly version |
| 3 | +# in a Dockerfile. It utilizes various components such as sources, conditions, targets, and actions |
| 4 | +# to achieve this automation. |
| 5 | + |
| 6 | +# Define the pipeline's name and the SCM (Source Control Management) configurations. |
| 7 | +name: Bump Jenkins' Weekly version in the controller Dockerfile |
| 8 | + |
| 9 | +scms: |
| 10 | + default: |
| 11 | + kind: github |
| 12 | + spec: |
| 13 | + user: "{{ .github.user }}" # GitHub user for authentication |
| 14 | + email: "{{ .github.email }}" # Email associated with the GitHub user |
| 15 | + owner: "{{ .github.owner }}" # Owner of the GitHub repository |
| 16 | + repository: "{{ .github.repository }}" # Name of the GitHub repository |
| 17 | + token: "{{ requiredEnv .github.token }}" # GitHub token for authentication |
| 18 | + username: "{{ .github.username }}" # GitHub username |
| 19 | + branch: "{{ .github.branch }}" # Branch to apply changes |
| 20 | + |
| 21 | +# Define the sources for the pipeline. These are the origins of data used in the pipeline. |
| 22 | +sources: |
| 23 | + JenkinsLatestWeekly: |
| 24 | + name: Get the latest Jenkins Weekly version |
| 25 | + kind: jenkins |
| 26 | + spec: |
| 27 | + release: weekly # Specifies that the weekly release of Jenkins is to be fetched |
| 28 | + JenkinsLatestWeeklyJDK17: |
| 29 | + name: Get the latest Jenkins Weekly version with JDK 17 |
| 30 | + kind: jenkins |
| 31 | + spec: |
| 32 | + release: weekly # Specifies that the weekly release of Jenkins is to be fetched |
| 33 | + jdk: 17 # Specifies JDK 17 for the Jenkins version |
| 34 | + transformers: |
| 35 | + - addsuffix: "-jdk17" # Adds a suffix to the version to denote JDK 17 |
| 36 | + |
| 37 | +# Define conditions that must be met for the pipeline to proceed. |
| 38 | +conditions: |
| 39 | + # Test that the latest Weekly Jenkins version exists |
| 40 | + jenkinsWeekly: |
| 41 | + kind: jenkins |
| 42 | + sourceid: JenkinsLatestWeekly # Links this condition to the JenkinsLatestWeekly source |
| 43 | + spec: |
| 44 | + release: weekly |
| 45 | + # Test that the docker image exists |
| 46 | + dockerImage: |
| 47 | + kind: dockerimage |
| 48 | + sourceid: JenkinsLatestWeekly # Links this condition to the JenkinsLatestWeekly source |
| 49 | + spec: |
| 50 | + image: "jenkins/jenkins" # Specifies the Docker image to check |
| 51 | + transformers: |
| 52 | + - addsuffix: "-jdk17" # Adds a suffix to denote JDK 17 |
| 53 | + |
| 54 | +# Define the targets for the pipeline. These are the end goals the pipeline aims to achieve. |
| 55 | +targets: |
| 56 | + setJenkinsLatestWeekly: |
| 57 | + kind: dockerfile |
| 58 | + sourceid: JenkinsLatestWeeklyJDK17 # Links this target to the JenkinsLatestWeeklyJDK17 source |
| 59 | + spec: |
| 60 | + file: dockerfiles/Dockerfile # Specifies the Dockerfile to be updated |
| 61 | + instruction: |
| 62 | + keyword: "ARG" # Specifies the Dockerfile instruction to update |
| 63 | + matcher: "JENKINS_VERSION" # Specifies the argument to be updated |
| 64 | + name: "[jenkins-controller] Bump Jenkins Weekly version in dockerfiles/Dockerfile" |
| 65 | + scmid: default # Links this target to the default SCM configuration |
| 66 | + |
| 67 | +# Define the actions to be taken once the conditions are met and targets are ready. |
| 68 | +actions: |
| 69 | + default: |
| 70 | + kind: github/pullrequest |
| 71 | + scmid: default # Links this action to the default SCM configuration |
| 72 | + title: Update Jenkins Weekly versions to {{ source "JenkinsLatestWeekly" }}-jdk17 in the controller Dockerfile |
| 73 | + spec: |
| 74 | + labels: |
| 75 | + - dependencies # Label for the pull request |
| 76 | + - chore # Label for the pull request |
0 commit comments