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' |
| 52 | submodule-recursive: 'false' |
| 53 | choosing-strategy: gerrit |
| 54 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 55 | |
| 56 | node: '{build-node}' |
| 57 | project-type: freestyle |
| 58 | concurrent: true |
| 59 | |
| 60 | builders: |
| 61 | - inject: |
| 62 | properties-content: |
| 63 | SEMVER_STRICT={semver-strict} |
| 64 | - shell: !include-raw-escape: ../shell/tag-check.sh |
| 65 | |
| 66 | |
| 67 | - job-template: |
| 68 | id: version-tag |
| 69 | name: "version-tag_{project}" |
| 70 | description: | |
| 71 | Created by {id} job-template from ci-management/jjb/templates/versioning.yaml |
| 72 | When a patch is merged, check if it contains a SemVer released version |
| 73 | file and if so tags the commit in git with that same version. |
| 74 | |
| 75 | triggers: |
| 76 | - onf-infra-gerrit-trigger-merge: |
| 77 | gerrit-server-name: '{gerrit-server-name}' |
| 78 | project-regexp: '^{project}$' |
| 79 | branch-regexp: '{branch-regexp}' |
| 80 | file-include-regexp: '{all-files-regexp}' |
| 81 | dependency-jobs: '{dependency-jobs}' |
| 82 | |
| 83 | properties: |
| 84 | - onf-infra-properties: |
| 85 | build-days-to-keep: '{build-days-to-keep}' |
| 86 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 87 | |
| 88 | wrappers: |
| 89 | - lf-infra-wrappers: |
| 90 | build-timeout: '{build-timeout}' |
| 91 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 92 | |
| 93 | scm: |
| 94 | - lf-infra-gerrit-scm: |
| 95 | git-url: '$GIT_URL/$GERRIT_PROJECT' |
| 96 | refspec: '$GERRIT_REFSPEC' |
| 97 | branch: '$GERRIT_BRANCH' |
| 98 | submodule-recursive: 'false' |
| 99 | choosing-strategy: gerrit |
| 100 | jenkins-ssh-credential: '{gerrit-ssh-credential}' |
| 101 | |
| 102 | node: '{build-node}' |
| 103 | project-type: freestyle |
| 104 | concurrent: true |
| 105 | |
| 106 | builders: |
| 107 | - inject: |
| 108 | properties-content: |
| 109 | SEMVER_STRICT={semver-strict} |
| 110 | - shell: !include-raw-escape: ../shell/version-tag.sh |
| 111 | |