blob: b69c86136d280f23476f753037cd134df3737e89 [file] [log] [blame]
Zack Williams12783ac2018-06-12 15:13:12 -07001---
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 Williams7127e922019-08-20 17:42:56 -070024 branch-regexp: '{all-branches-regexp}'
Zack Williams07949bb2018-07-20 07:29:15 -070025 project-regexp: '{version-tag-projects-regexp}'
Zack Williams12783ac2018-06-12 15:13:12 -070026
27 jobs:
Zack Williams12783ac2018-06-12 15:13:12 -070028 - 'version-tag'
29
30- job-template:
31 id: tag-collision-reject
Zack Williamsb7a509a2018-06-22 17:00:50 -070032 name: "verify_{project}_tag-collision"
Zack Williams12783ac2018-06-12 15:13:12 -070033 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 Williamsb7a509a2018-06-22 17:00:50 -070041 project-regexp: '^{project}$'
Zack Williams12783ac2018-06-12 15:13:12 -070042 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 Williams8e69efd2018-06-13 15:05:18 -070054 jenkins-ssh-credential: '{gerrit-ssh-credential}'
Zack Williams12783ac2018-06-12 15:13:12 -070055
56 scm:
57 - lf-infra-gerrit-scm:
58 git-url: '$GIT_URL/$GERRIT_PROJECT'
59 refspec: '$GERRIT_REFSPEC'
60 branch: '$GERRIT_BRANCH'
61 submodule-recursive: 'false'
62 choosing-strategy: gerrit
Zack Williams8e69efd2018-06-13 15:05:18 -070063 jenkins-ssh-credential: '{gerrit-ssh-credential}'
Zack Williams12783ac2018-06-12 15:13:12 -070064
65 node: '{build-node}'
66 project-type: freestyle
67 concurrent: true
68
69 builders:
Zack Williams66500002018-09-06 15:29:05 -070070 - inject:
71 properties-content:
72 SEMVER_STRICT={semver-strict}
Zack Williams12783ac2018-06-12 15:13:12 -070073 - shell: !include-raw-escape: shell/tagcollisionreject.sh
74
75
76- job-template:
77 id: version-tag
78 name: "version-tag"
79 description: |
80 Created by {id} job-template from ci-management/jjb/release.yaml
81 When a patch is merged, check if it contains a SemVer released version
82 file and if so tags the commit in git with that same version.
83
84 triggers:
85 - cord-infra-gerrit-trigger-merge:
86 gerrit-server-name: '{gerrit-server-name}'
Zack Williams8e69efd2018-06-13 15:05:18 -070087 project-regexp: '{project-regexp}'
Zack Williams12783ac2018-06-12 15:13:12 -070088 branch-regexp: '{branch-regexp}'
89 file-include-regexp: '{all-files-regexp}'
90 dependency-jobs: '{dependency-jobs}'
91
92 properties:
93 - cord-infra-properties:
94 build-days-to-keep: '{build-days-to-keep}'
95 artifact-num-to-keep: '{artifact-num-to-keep}'
96
97 wrappers:
98 - lf-infra-wrappers:
99 build-timeout: '{build-timeout}'
Zack Williams8e69efd2018-06-13 15:05:18 -0700100 jenkins-ssh-credential: '{gerrit-ssh-credential}'
Zack Williams12783ac2018-06-12 15:13:12 -0700101
102 scm:
103 - lf-infra-gerrit-scm:
104 git-url: '$GIT_URL/$GERRIT_PROJECT'
105 refspec: '$GERRIT_REFSPEC'
106 branch: '$GERRIT_BRANCH'
107 submodule-recursive: 'false'
108 choosing-strategy: gerrit
Zack Williams8e69efd2018-06-13 15:05:18 -0700109 jenkins-ssh-credential: '{gerrit-ssh-credential}'
Zack Williams12783ac2018-06-12 15:13:12 -0700110
111 node: '{build-node}'
112 project-type: freestyle
113 concurrent: true
114
115 builders:
Zack Williams66500002018-09-06 15:29:05 -0700116 - inject:
117 properties-content:
118 SEMVER_STRICT={semver-strict}
Zack Williams12783ac2018-06-12 15:13:12 -0700119 - shell: !include-raw-escape: shell/versiontag.sh
120