Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 1 | --- |
| 2 | # CORD versioning jobs for tagging/releasing software |
| 3 | |
| 4 | # CORD versioning conventions: |
| 5 | # |
| 6 | # 1. There is a 1:1 relationship between SemVer _release_ versions described |
| 7 | # in the commit and the git tag applied to that commit by Jenkins. |
| 8 | # |
| 9 | # 2. Non-release versions (ex: 1.0.1-dev3, etc.) can exist in multiple |
| 10 | # commits, and don't trigger creation of git tags. |
| 11 | # |
| 12 | # 3. Git history is public, and therefore shouldn't be rewritten to abandon |
| 13 | # already merged commits |
| 14 | # |
| 15 | # 4. Reverting a commit leaves it in history, so if a broken version is |
| 16 | # released, the correct action is to make a new fixed version, not try to |
| 17 | # fix the released version |
| 18 | # |
| 19 | # See also: https://jira.opencord.org/browse/CORD-3117 |
| 20 | |
| 21 | - project: |
| 22 | name: versioning-jobs |
| 23 | |
Zack Williams | 7127e92 | 2019-08-20 17:42:56 -0700 | [diff] [blame] | 24 | branch-regexp: '{all-branches-regexp}' |
Zack Williams | 07949bb | 2018-07-20 07:29:15 -0700 | [diff] [blame] | 25 | project-regexp: '{version-tag-projects-regexp}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 26 | |
| 27 | jobs: |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 28 | - 'version-tag' |
| 29 | |
| 30 | - job-template: |
| 31 | id: tag-collision-reject |
Zack Williams | b7a509a | 2018-06-22 17:00:50 -0700 | [diff] [blame] | 32 | name: "verify_{project}_tag-collision" |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 33 | description: | |
| 34 | Created by {id} job-template from ci-management/jjb/versioning.yaml |
| 35 | Checks for changes to version files, and that they don't duplicate tags |
| 36 | already in the git repo. |
| 37 | |
| 38 | triggers: |
| 39 | - cord-infra-gerrit-trigger-patchset: |
| 40 | gerrit-server-name: '{gerrit-server-name}' |
Zack Williams | b7a509a | 2018-06-22 17:00:50 -0700 | [diff] [blame] | 41 | project-regexp: '^{project}$' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 42 | branch-regexp: '{branch-regexp}' |
| 43 | file-include-regexp: '{all-files-regexp}' |
| 44 | dependency-jobs: '{dependency-jobs}' |
| 45 | |
| 46 | properties: |
| 47 | - cord-infra-properties: |
| 48 | build-days-to-keep: '{build-days-to-keep}' |
| 49 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 50 | |
| 51 | wrappers: |
| 52 | - lf-infra-wrappers: |
| 53 | build-timeout: '{build-timeout}' |
Zack Williams | 8e69efd | 2018-06-13 15:05:18 -0700 | [diff] [blame] | 54 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 55 | |
| 56 | scm: |
| 57 | - lf-infra-gerrit-scm: |
| 58 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 59 | refspec: '$GERRIT_REFSPEC' |
| 60 | branch: '$GERRIT_BRANCH' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 61 | submodule-disable: '{submodule-disable}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 62 | submodule-recursive: 'false' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 63 | submodule-timeout: '{submodule-timeout}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 64 | choosing-strategy: gerrit |
Zack Williams | 8e69efd | 2018-06-13 15:05:18 -0700 | [diff] [blame] | 65 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 66 | |
| 67 | node: '{build-node}' |
| 68 | project-type: freestyle |
| 69 | concurrent: true |
| 70 | |
| 71 | builders: |
Zack Williams | 6650000 | 2018-09-06 15:29:05 -0700 | [diff] [blame] | 72 | - inject: |
| 73 | properties-content: |
| 74 | SEMVER_STRICT={semver-strict} |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 75 | - shell: !include-raw-escape: shell/tagcollisionreject.sh |
| 76 | |
| 77 | |
| 78 | - job-template: |
| 79 | id: version-tag |
| 80 | name: "version-tag" |
| 81 | description: | |
hwchiu | e3815ab | 2019-10-17 15:06:25 -0700 | [diff] [blame] | 82 | Created by {id} job-template from ci-management/jjb/versioning.yaml |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 83 | When a patch is merged, check if it contains a SemVer released version |
| 84 | file and if so tags the commit in git with that same version. |
| 85 | |
| 86 | triggers: |
| 87 | - cord-infra-gerrit-trigger-merge: |
| 88 | gerrit-server-name: '{gerrit-server-name}' |
Zack Williams | 8e69efd | 2018-06-13 15:05:18 -0700 | [diff] [blame] | 89 | project-regexp: '{project-regexp}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 90 | branch-regexp: '{branch-regexp}' |
| 91 | file-include-regexp: '{all-files-regexp}' |
| 92 | dependency-jobs: '{dependency-jobs}' |
| 93 | |
| 94 | properties: |
| 95 | - cord-infra-properties: |
| 96 | build-days-to-keep: '{build-days-to-keep}' |
| 97 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 98 | |
| 99 | wrappers: |
| 100 | - lf-infra-wrappers: |
| 101 | build-timeout: '{build-timeout}' |
Zack Williams | 8e69efd | 2018-06-13 15:05:18 -0700 | [diff] [blame] | 102 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 103 | |
| 104 | scm: |
| 105 | - lf-infra-gerrit-scm: |
| 106 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 107 | refspec: '$GERRIT_REFSPEC' |
| 108 | branch: '$GERRIT_BRANCH' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 109 | submodule-disable: '{submodule-disable}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 110 | submodule-recursive: 'false' |
Zack Williams | ccc1474 | 2020-01-22 13:15:59 -0700 | [diff] [blame] | 111 | submodule-timeout: '{submodule-timeout}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 112 | choosing-strategy: gerrit |
Zack Williams | 8e69efd | 2018-06-13 15:05:18 -0700 | [diff] [blame] | 113 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 114 | |
| 115 | node: '{build-node}' |
| 116 | project-type: freestyle |
| 117 | concurrent: true |
| 118 | |
| 119 | builders: |
Zack Williams | 6650000 | 2018-09-06 15:29:05 -0700 | [diff] [blame] | 120 | - inject: |
| 121 | properties-content: |
| 122 | SEMVER_STRICT={semver-strict} |
Zack Williams | 12783ac | 2018-06-12 15:13:12 -0700 | [diff] [blame] | 123 | - shell: !include-raw-escape: shell/versiontag.sh |
| 124 | |