blob: d51efdbcaad92d28150e45a7811cbf5d8379e1b3 [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
24 branch-regexp: '{modern-branches-regexp}'
25 project: '^bogus-project$'
26
27 jobs:
28 - 'tag-collision-reject'
29 - 'version-tag'
30
31- job-template:
32 id: tag-collision-reject
33 name: "tag-collision-reject"
34 description: |
35 Created by {id} job-template from ci-management/jjb/versioning.yaml
36 Checks for changes to version files, and that they don't duplicate tags
37 already in the git repo.
38
39 triggers:
40 - cord-infra-gerrit-trigger-patchset:
41 gerrit-server-name: '{gerrit-server-name}'
42 project-regexp: '^{project}$'
43 branch-regexp: '{branch-regexp}'
44 file-include-regexp: '{all-files-regexp}'
45 dependency-jobs: '{dependency-jobs}'
46
47 properties:
48 - cord-infra-properties:
49 build-days-to-keep: '{build-days-to-keep}'
50 artifact-num-to-keep: '{artifact-num-to-keep}'
51
52 wrappers:
53 - lf-infra-wrappers:
54 build-timeout: '{build-timeout}'
55 jenkins-ssh-credential: '{jenkins-ssh-credential}'
56
57 scm:
58 - lf-infra-gerrit-scm:
59 git-url: '$GIT_URL/$GERRIT_PROJECT'
60 refspec: '$GERRIT_REFSPEC'
61 branch: '$GERRIT_BRANCH'
62 submodule-recursive: 'false'
63 choosing-strategy: gerrit
64 jenkins-ssh-credential: '{jenkins-ssh-credential}'
65
66 node: '{build-node}'
67 project-type: freestyle
68 concurrent: true
69
70 builders:
71 - shell: !include-raw-escape: shell/tagcollisionreject.sh
72
73
74- job-template:
75 id: version-tag
76 name: "version-tag"
77 description: |
78 Created by {id} job-template from ci-management/jjb/release.yaml
79 When a patch is merged, check if it contains a SemVer released version
80 file and if so tags the commit in git with that same version.
81
82 triggers:
83 - cord-infra-gerrit-trigger-merge:
84 gerrit-server-name: '{gerrit-server-name}'
85 project-regexp: '^{project}$'
86 branch-regexp: '{branch-regexp}'
87 file-include-regexp: '{all-files-regexp}'
88 dependency-jobs: '{dependency-jobs}'
89
90 properties:
91 - cord-infra-properties:
92 build-days-to-keep: '{build-days-to-keep}'
93 artifact-num-to-keep: '{artifact-num-to-keep}'
94
95 wrappers:
96 - lf-infra-wrappers:
97 build-timeout: '{build-timeout}'
98 jenkins-ssh-credential: '{jenkins-ssh-credential}'
99
100 scm:
101 - lf-infra-gerrit-scm:
102 git-url: '$GIT_URL/$GERRIT_PROJECT'
103 refspec: '$GERRIT_REFSPEC'
104 branch: '$GERRIT_BRANCH'
105 submodule-recursive: 'false'
106 choosing-strategy: gerrit
107 jenkins-ssh-credential: '{jenkins-ssh-credential}'
108
109 node: '{build-node}'
110 project-type: freestyle
111 concurrent: true
112
113 builders:
114 - shell: !include-raw-escape: shell/versiontag.sh
115