Zack Williams | be54231 | 2022-06-23 21:51:32 -0700 | [diff] [blame] | 1 | --- |
| 2 | # SPDX-FileCopyrightText: 2018-2022 Open Networking Foundation <info@opennetworking.org> |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | # versioning jobs for tagging/releasing software |
| 6 | |
| 7 | # Versioning conventions: |
| 8 | # |
| 9 | # 1. There is a 1:1 relationship between SemVer _release_ versions described |
| 10 | # in the commit and the git tag applied to that commit by Jenkins. |
| 11 | # |
| 12 | # 2. Non-release versions (ex: 1.0.1-dev3, etc.) can exist in multiple |
| 13 | # commits, and don't trigger creation of git tags. |
| 14 | # |
| 15 | # 3. Git history is public, and therefore shouldn't be rewritten to abandon |
| 16 | # already merged commits |
| 17 | # |
| 18 | # 4. Reverting a commit leaves it in history, so if a broken version is |
| 19 | # released, the correct action is to make a new fixed version, not try to |
| 20 | # fix the released version |
| 21 | # |
| 22 | # For reference: https://jira.opencord.org/browse/CORD-3117 |
| 23 | |
| 24 | - job-template: |
| 25 | id: tag-check |
| 26 | name: "tag-check_{project}" |
| 27 | description: | |
| 28 | Created by {id} job-template from ci-management/jjb/templates/versioning.yaml |
| 29 | Checks for changes to version files, and that they don't duplicate tags |
| 30 | already in the git repo. |
| 31 | disabled: '{disable-job}' |
| 32 | |
| 33 | triggers: |
| 34 | - onf-infra-gerrit-trigger-patchset: |
| 35 | gerrit-server-name: '{gerrit-server-name}' |
| 36 | project-regexp: '{project-regexp}' |
| 37 | branch-regexp: '{branch-regexp}' |
| 38 | file-include-regexp: '{all-files-regexp}' |
| 39 | dependency-jobs: '{dependency-jobs}' |
| 40 | |
| 41 | properties: |
| 42 | - onf-infra-properties: |
| 43 | build-days-to-keep: '{build-days-to-keep}' |
| 44 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 45 | |
| 46 | wrappers: |
| 47 | - lf-infra-wrappers: |
| 48 | build-timeout: '{build-timeout}' |
| 49 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 50 | |
| 51 | scm: |
| 52 | - onf-infra-gerrit-scm: |
| 53 | git-url: '{gerrit-server-ssh-url}/$GERRIT_PROJECT' |
| 54 | refspec: '$GERRIT_REFSPEC' |
| 55 | branch: '$GERRIT_BRANCH' |
| 56 | submodule-disable: '{submodule-disable}' |
| 57 | submodule-recursive: '{submodule-recursive}' |
| 58 | submodule-timeout: '{submodule-timeout}' |
| 59 | choosing-strategy: gerrit |
| 60 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 61 | basedir: '$GERRIT_PROJECT' |
| 62 | |
| 63 | node: '{build-node}' |
| 64 | project-type: freestyle |
| 65 | concurrent: true |
| 66 | |
| 67 | builders: |
| 68 | - inject: |
| 69 | properties-content: | |
| 70 | SEMVER_STRICT={semver-strict} |
| 71 | BASEDIR=$GERRIT_PROJECT |
| 72 | - shell: !include-raw-escape: jjb/shell/tag-check.sh |
| 73 | |
| 74 | - job-template: |
| 75 | id: version-tag |
| 76 | name: "version-tag_{project}" |
| 77 | disabled: '{disable-job}' |
| 78 | description: | |
| 79 | Created by {id} job-template from ci-management/jjb/templates/versioning.yaml |
| 80 | When a patch is merged, check if it contains a SemVer released version |
| 81 | file and if so tags thxe commit in git with that same version. |
| 82 | |
| 83 | triggers: |
| 84 | - onf-infra-gerrit-trigger-merge: |
| 85 | gerrit-server-name: '{gerrit-server-name}' |
| 86 | project-regexp: '{project-regexp}' |
| 87 | branch-regexp: '{all-branches-regexp}' |
| 88 | file-include-regexp: '{all-files-regexp}' |
| 89 | dependency-jobs: '{dependency-jobs}' |
| 90 | |
| 91 | properties: |
| 92 | - onf-infra-properties: |
| 93 | build-days-to-keep: '{build-days-to-keep}' |
| 94 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 95 | |
| 96 | wrappers: |
| 97 | - lf-infra-wrappers: |
| 98 | build-timeout: '{build-timeout}' |
| 99 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 100 | |
| 101 | scm: |
| 102 | - onf-infra-gerrit-scm: |
| 103 | git-url: '{gerrit-server-ssh-url}/$GERRIT_PROJECT' |
| 104 | refspec: '$GERRIT_REFSPEC' |
| 105 | branch: '$GERRIT_BRANCH' |
| 106 | submodule-disable: '{submodule-disable}' |
| 107 | submodule-recursive: 'false' |
| 108 | submodule-timeout: '{submodule-timeout}' |
| 109 | choosing-strategy: gerrit |
| 110 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 111 | basedir: '' |
| 112 | |
| 113 | node: '{build-node}' |
| 114 | project-type: freestyle |
| 115 | concurrent: true |
| 116 | |
| 117 | builders: |
| 118 | - inject: |
| 119 | properties-content: | |
| 120 | SEMVER_STRICT={semver-strict} |
| 121 | BASEDIR=$GERRIT_PROJECT |
| 122 | - shell: !include-raw-escape: jjb/shell/version-tag.sh |
| 123 | |
| 124 | - job-template: |
| 125 | id: version-tag-github |
| 126 | name: "version-tag_{project}" |
| 127 | disabled: '{disable-job}' |
| 128 | description: | |
| 129 | Created by {id} job-template from ci-management/jjb/templates/versioning.yaml |
| 130 | When a patch is merged, check if it contains a SemVer released version |
| 131 | file and if so tags thxe commit in git with that same version. |
| 132 | |
| 133 | properties: |
| 134 | - onf-infra-properties: |
| 135 | build-days-to-keep: '{build-days-to-keep}' |
| 136 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 137 | - github: |
| 138 | url: 'https://github.com/{github-organization}/{project}' |
| 139 | |
| 140 | wrappers: |
| 141 | - lf-infra-wrappers: |
| 142 | build-timeout: '{build-timeout}' |
| 143 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 144 | |
| 145 | parameters: |
| 146 | - onf-infra-github-pr-merge-parameters: |
| 147 | repo-name: '{project}' |
| 148 | repo-url: '{github-ssh-url}{github-organization}/{project}.git' |
| 149 | branch: '{branch}' |
| 150 | commitHash: '{branch}' |
| 151 | |
| 152 | triggers: |
| 153 | - onf-infra-github-pr-trigger: |
| 154 | github-token: '{github-token}' |
| 155 | status-context: 'Aether Jenkins - Makefile test' |
| 156 | trigger-phrase: '.*test\W+(make|makefile|version|versioning).*|{trigger-phrase}' |
| 157 | white-list-target-branches: '{white-list-target-branches}' |
| 158 | github_pr_org_list: '{obj:github_pr_org_list}' |
| 159 | |
| 160 | scm: |
| 161 | - onf-infra-github-scm: |
| 162 | url: '{github-ssh-url}{github-organization}/{project}' |
| 163 | refspec: "{github-refspec-branch}" |
| 164 | branch: "$commitHash" |
| 165 | submodule-disable: "{submodule-disable}" |
| 166 | submodule-recursive: "{submodule-recursive}" |
| 167 | submodule-timeout: "{submodule-timeout}" |
| 168 | choosing-strategy: default |
| 169 | jenkins-ssh-credential: "{github-ssh-credential}" |
| 170 | basedir: '' |
| 171 | |
| 172 | node: '{build-node}' |
| 173 | project-type: freestyle |
| 174 | concurrent: true |
| 175 | |
| 176 | builders: |
| 177 | - shell: !include-raw-escape: jjb/shell/version-tag.sh |