Build RMR libraries with CMake templates
[ci-management.git] / jjb / oran-templates / oran-c-cpp-jobs.yaml
1 #   Copyright (c) 2020 AT&T Intellectual Property.
2 #
3 #   Licensed under the Apache License, Version 2.0 (the 'License');
4 #   you may not use this file except in compliance with the License.
5 #   You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #   Unless required by applicable law or agreed to in writing, software
10 #   distributed under the License is distributed on an 'AS IS' BASIS,
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #   See the License for the specific language governing permissions and
13 #   limitations under the License.
14 ---
15
16 # This file is structured with a cmake alias/anchor, an alias/anchor,
17 # and a job-template to simplify the task of lifting it to global-jjb.
18
19 ####################
20 # COMMON FUNCTIONS #
21 ####################
22
23 # Clone of lf_cmake_common which isn't visible here
24 - oran_cmake_common: &oran_cmake_common
25     name: oran-cmake-common
26
27     #####################
28     # Job Configuration #
29     #####################
30
31     project-type: freestyle
32     node: "{build-node}"
33     disabled: "{disable-job}"
34
35     properties:
36       - lf-infra-properties:
37           build-days-to-keep: "{build-days-to-keep}"
38
39     parameters:
40       - lf-infra-parameters:
41           project: "{project}"
42           branch: "{branch}"
43           stream: "{stream}"
44       - lf-cmake-parameters:
45           build-dir: "{build-dir}"
46           cmake-opts: "{cmake-opts}"
47           install-prefix: "{install-prefix}"
48           make-opts: "{make-opts}"
49
50     wrappers:
51       - lf-infra-wrappers:
52           build-timeout: "{build-timeout}"
53           jenkins-ssh-credential: "{jenkins-ssh-credential}"
54
55     publishers:
56       - lf-infra-publish
57
58 ##################
59 # CMAKE+PC STAGE #
60 ##################
61
62 - oran_cmake_pc_stage: &oran_cmake_pc_stage
63     name: oran-cmake-pc-stage
64
65     ######################
66     # Default parameters #
67     ######################
68
69     branch: master
70     build-days-to-keep: 7
71     build-dir: "$WORKSPACE/build"
72     build-timeout: 15
73     cmake-opts: ""
74     cron: "" # avoid for PackageCloud which rejects duplicates
75     disable-job: false
76     git-url: "$GIT_URL/$PROJECT"
77     github-url: "https://github.com"
78     install-prefix: "$BUILD_DIR/output"
79     make-opts: ""
80     pre-build: ""
81     stream: master
82     submodule-recursive: true
83     submodule-timeout: 10
84     submodule-disable: false
85
86     gerrit_trigger_file_paths:
87       - compare-type: REG_EXP
88         pattern: ".*"
89
90     # github_included_regions MUST match gerrit_trigger_file_paths
91     github_included_regions:
92       - ".*"
93
94     builders:
95       - config-file-provider:
96           files:
97             - file-id: ".packagecloud"
98               target: "$HOME/.packagecloud"
99       - shell: "{pre-build}"
100       - shell: !include-raw-escape: ../shell/cmake-package.sh
101       - oran-packagecloud-push:
102           build-dir: "{build-dir}"
103           packagecloud-account: "{packagecloud-account}"
104           packagecloud-repo: "{packagecloud-repo}"
105           debian-distribution-versions: "{debian-distribution-versions}"
106           rpm-distribution-versions: "{rpm-distribution-versions}"
107
108 - job-template:
109     # build with cmake and publish to PackageCloud on command
110     name: "{project-name}-cmake-pc-stage-{stream}"
111     id: oran-gerrit-cmake-pc-stage
112     <<: *oran_cmake_common
113     <<: *oran_cmake_pc_stage
114
115     ######################
116     # Default parameters #
117     ######################
118
119     gerrit_stage_triggers:
120       - comment-added-contains-event:
121           comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
122
123     #####################
124     # Job Configuration #
125     #####################
126
127     scm:
128       - lf-infra-gerrit-scm:
129           jenkins-ssh-credential: "{jenkins-ssh-credential}"
130           git-url: "{git-url}"
131           refspec: "$GERRIT_REFSPEC"
132           branch: "$GERRIT_BRANCH"
133           submodule-recursive: "{submodule-recursive}"
134           submodule-timeout: "{submodule-timeout}"
135           submodule-disable: "{submodule-disable}"
136           # stage jobs always build from tip
137           choosing-strategy: default
138
139     triggers:
140       - timed: "{obj:cron}"
141       - gerrit:
142           server-name: "{gerrit-server-name}"
143           trigger-on: "{obj:gerrit_stage_triggers}"
144           projects:
145             - project-compare-type: ANT
146               project-pattern: "{project}"
147               branches:
148                 - branch-compare-type: ANT
149                   branch-pattern: "**/{branch}"
150               file-paths: "{obj:gerrit_trigger_file_paths}"