Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 1 | --- |
| 2 | # versioning jobs for tagging/releasing software |
| 3 | |
| 4 | # 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 | # For reference: https://jira.opencord.org/browse/CORD-3117 |
| 20 | |
| 21 | - job-template: |
| 22 | id: tag-check |
| 23 | name: "tag-check_{project}" |
| 24 | description: | |
| 25 | Created by {id} job-template from ci-management/jjb/templates/versioning.yaml |
| 26 | Checks for changes to version files, and that they don't duplicate tags |
| 27 | already in the git repo. |
| 28 | |
| 29 | triggers: |
| 30 | - onf-infra-gerrit-trigger-patchset: |
| 31 | gerrit-server-name: '{gerrit-server-name}' |
| 32 | project-regexp: '^{project}$' |
| 33 | branch-regexp: '{branch-regexp}' |
| 34 | file-include-regexp: '{all-files-regexp}' |
| 35 | dependency-jobs: '{dependency-jobs}' |
| 36 | |
| 37 | properties: |
| 38 | - onf-infra-properties: |
| 39 | build-days-to-keep: '{build-days-to-keep}' |
| 40 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 41 | |
| 42 | wrappers: |
| 43 | - lf-infra-wrappers: |
| 44 | build-timeout: '{build-timeout}' |
| 45 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 46 | |
| 47 | scm: |
| 48 | - lf-infra-gerrit-scm: |
| 49 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 50 | refspec: '$GERRIT_REFSPEC' |
| 51 | branch: '$GERRIT_BRANCH' |
Zack Williams | 05f0608 | 2020-01-22 14:19:34 -0700 | [diff] [blame] | 52 | submodule-disable: '{submodule-disable}' |
| 53 | submodule-recursive: '{submodule-recursive}' |
| 54 | submodule-timeout: '{submodule-timeout}' |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 55 | choosing-strategy: gerrit |
| 56 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 57 | |
| 58 | node: '{build-node}' |
| 59 | project-type: freestyle |
| 60 | concurrent: true |
| 61 | |
| 62 | builders: |
| 63 | - inject: |
| 64 | properties-content: |
| 65 | SEMVER_STRICT={semver-strict} |
| 66 | - shell: !include-raw-escape: ../shell/tag-check.sh |
| 67 | |
| 68 | |
| 69 | - job-template: |
| 70 | id: version-tag |
| 71 | name: "version-tag_{project}" |
| 72 | description: | |
| 73 | Created by {id} job-template from ci-management/jjb/templates/versioning.yaml |
| 74 | When a patch is merged, check if it contains a SemVer released version |
| 75 | file and if so tags the commit in git with that same version. |
| 76 | |
| 77 | triggers: |
| 78 | - onf-infra-gerrit-trigger-merge: |
| 79 | gerrit-server-name: '{gerrit-server-name}' |
| 80 | project-regexp: '^{project}$' |
| 81 | branch-regexp: '{branch-regexp}' |
| 82 | file-include-regexp: '{all-files-regexp}' |
| 83 | dependency-jobs: '{dependency-jobs}' |
| 84 | |
| 85 | properties: |
| 86 | - onf-infra-properties: |
| 87 | build-days-to-keep: '{build-days-to-keep}' |
| 88 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 89 | |
| 90 | wrappers: |
| 91 | - lf-infra-wrappers: |
| 92 | build-timeout: '{build-timeout}' |
| 93 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 94 | |
| 95 | scm: |
| 96 | - lf-infra-gerrit-scm: |
| 97 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 98 | refspec: '$GERRIT_REFSPEC' |
| 99 | branch: '$GERRIT_BRANCH' |
Zack Williams | 05f0608 | 2020-01-22 14:19:34 -0700 | [diff] [blame] | 100 | submodule-disable: '{submodule-disable}' |
| 101 | submodule-recursive: '{submodule-recursive}' |
| 102 | submodule-timeout: '{submodule-timeout}' |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 103 | choosing-strategy: gerrit |
| 104 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 105 | |
| 106 | node: '{build-node}' |
| 107 | project-type: freestyle |
| 108 | concurrent: true |
| 109 | |
| 110 | builders: |
| 111 | - inject: |
| 112 | properties-content: |
| 113 | SEMVER_STRICT={semver-strict} |
| 114 | - shell: !include-raw-escape: ../shell/version-tag.sh |
| 115 | |