blob: 2affdf2f49f040ef12b63359e0af9e9cfb550252 [file] [log] [blame]
Zack Williams3403ff42019-08-13 18:30:42 -07001---
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.
pierventre4a959602020-11-02 14:46:19 +010028 disabled: '{disable-job}'
Zack Williams3403ff42019-08-13 18:30:42 -070029
30 triggers:
31 - onf-infra-gerrit-trigger-patchset:
32 gerrit-server-name: '{gerrit-server-name}'
33 project-regexp: '^{project}$'
34 branch-regexp: '{branch-regexp}'
35 file-include-regexp: '{all-files-regexp}'
36 dependency-jobs: '{dependency-jobs}'
37
38 properties:
39 - onf-infra-properties:
40 build-days-to-keep: '{build-days-to-keep}'
41 artifact-num-to-keep: '{artifact-num-to-keep}'
42
43 wrappers:
44 - lf-infra-wrappers:
45 build-timeout: '{build-timeout}'
46 jenkins-ssh-credential: '{gerrit-ssh-credential}'
47
48 scm:
49 - lf-infra-gerrit-scm:
50 git-url: '$GIT_URL/$GERRIT_PROJECT'
51 refspec: '$GERRIT_REFSPEC'
52 branch: '$GERRIT_BRANCH'
Zack Williams05f06082020-01-22 14:19:34 -070053 submodule-disable: '{submodule-disable}'
54 submodule-recursive: '{submodule-recursive}'
55 submodule-timeout: '{submodule-timeout}'
Zack Williams3403ff42019-08-13 18:30:42 -070056 choosing-strategy: gerrit
57 jenkins-ssh-credential: '{gerrit-ssh-credential}'
58
59 node: '{build-node}'
60 project-type: freestyle
61 concurrent: true
62
63 builders:
64 - inject:
65 properties-content:
66 SEMVER_STRICT={semver-strict}
67 - shell: !include-raw-escape: ../shell/tag-check.sh
68
69
70- job-template:
71 id: version-tag
72 name: "version-tag_{project}"
73 description: |
74 Created by {id} job-template from ci-management/jjb/templates/versioning.yaml
75 When a patch is merged, check if it contains a SemVer released version
76 file and if so tags the commit in git with that same version.
pierventre4a959602020-11-02 14:46:19 +010077 disabled: '{disable-job}'
Zack Williams3403ff42019-08-13 18:30:42 -070078
79 triggers:
80 - onf-infra-gerrit-trigger-merge:
81 gerrit-server-name: '{gerrit-server-name}'
82 project-regexp: '^{project}$'
83 branch-regexp: '{branch-regexp}'
84 file-include-regexp: '{all-files-regexp}'
85 dependency-jobs: '{dependency-jobs}'
86
87 properties:
88 - onf-infra-properties:
89 build-days-to-keep: '{build-days-to-keep}'
90 artifact-num-to-keep: '{artifact-num-to-keep}'
91
92 wrappers:
93 - lf-infra-wrappers:
94 build-timeout: '{build-timeout}'
95 jenkins-ssh-credential: '{gerrit-ssh-credential}'
96
97 scm:
98 - lf-infra-gerrit-scm:
99 git-url: '$GIT_URL/$GERRIT_PROJECT'
100 refspec: '$GERRIT_REFSPEC'
101 branch: '$GERRIT_BRANCH'
Zack Williams05f06082020-01-22 14:19:34 -0700102 submodule-disable: '{submodule-disable}'
103 submodule-recursive: '{submodule-recursive}'
104 submodule-timeout: '{submodule-timeout}'
Zack Williams3403ff42019-08-13 18:30:42 -0700105 choosing-strategy: gerrit
106 jenkins-ssh-credential: '{gerrit-ssh-credential}'
107
108 node: '{build-node}'
109 project-type: freestyle
110 concurrent: true
111
112 builders:
113 - inject:
114 properties-content:
115 SEMVER_STRICT={semver-strict}
116 - shell: !include-raw-escape: ../shell/version-tag.sh
117