blob: e69cd36115e608703aedcade43bad11e816723a9 [file] [log] [blame]
Zack Williams7468c362018-04-06 09:52:30 -07001---
Joey Armstrong054d8312024-02-22 12:19:37 -05002# -----------------------------------------------------------------------
3# Copyright 2018-2024 Open Networking Foundation Contributors
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-FileCopyrightText: 2018-2024 Open Networking Foundation Contributors
18# SPDX-License-Identifier: Apache-2.0
19# -----------------------------------------------------------------------
20# Entropy: 0fcb5ffa-d1a4-11ee-be5e-9f44b7181764
21# -----------------------------------------------------------------------
22# Intent:
Zack Williams7468c362018-04-06 09:52:30 -070023# CORD lint and static code validation job templates
Zack Williams92f9b1f2018-04-11 09:58:49 -070024# These are invoked by the per-git-repo jobs stored in verify/
Joey Armstrong054d8312024-02-22 12:19:37 -050025# -----------------------------------------------------------------------
Zack Williams7468c362018-04-06 09:52:30 -070026
27# Verify that there is valid license/copyright on files
28- job-template:
29 id: verify-licensed
Zack Williams92f9b1f2018-04-11 09:58:49 -070030 name: 'verify_{project}_licensed'
31 description: |
Zack Williams92f9b1f2018-04-11 09:58:49 -070032 Created by verify-licensed job-template from ci-management/jjb/lint.yaml
Zack Williams7468c362018-04-06 09:52:30 -070033
34 triggers:
35 - cord-infra-gerrit-trigger-patchset:
36 gerrit-server-name: '{gerrit-server-name}'
37 project-regexp: '^{project}$'
38 branch-regexp: '{branch-regexp}'
Zack Williamsc27ca2d2018-04-11 13:16:45 -070039 file-include-regexp: '{all-files-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070040 dependency-jobs: '{dependency-jobs}'
41
42 properties:
43 - cord-infra-properties:
44 build-days-to-keep: '{build-days-to-keep}'
45 artifact-num-to-keep: '{artifact-num-to-keep}'
46
47 wrappers:
48 - lf-infra-wrappers:
49 build-timeout: '{build-timeout}'
50 jenkins-ssh-credential: '{jenkins-ssh-credential}'
51
52 scm:
53 - lf-infra-gerrit-scm:
54 git-url: '$GIT_URL/$GERRIT_PROJECT'
55 refspec: '$GERRIT_REFSPEC'
56 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -070057 submodule-disable: '{submodule-disable}'
Zack Williams7468c362018-04-06 09:52:30 -070058 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -070059 submodule-timeout: '{submodule-timeout}'
Zack Williams7468c362018-04-06 09:52:30 -070060 choosing-strategy: gerrit
61 jenkins-ssh-credential: '{jenkins-ssh-credential}'
62
63 node: '{build-node}'
64 project-type: freestyle
65 concurrent: true
66
67 builders:
68 - shell: !include-raw-escape: shell/licensecheck.sh
69
70
71# run `ansible-lint` to validate ansible playbooks/roles
72- job-template:
73 id: verify-ansible-lint
Zack Williams92f9b1f2018-04-11 09:58:49 -070074 name: 'verify_{project}_ansible-lint'
Joey Armstrong1cc90292024-04-02 09:27:33 -040075 description: >+
76 Created by verify-ansible-lint job-template
77 from ci-management/jjb/lint.yaml
Zack Williams7468c362018-04-06 09:52:30 -070078
79 triggers:
80 - cord-infra-gerrit-trigger-patchset:
81 gerrit-server-name: '{gerrit-server-name}'
82 project-regexp: '^{project}$'
83 branch-regexp: '{branch-regexp}'
Zack Williamsc27ca2d2018-04-11 13:16:45 -070084 file-include-regexp: '{all-files-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070085 dependency-jobs: '{dependency-jobs}'
86
87 properties:
88 - cord-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: '{jenkins-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 Williamsccc14742020-01-22 13:15:59 -0700102 submodule-disable: '{submodule-disable}'
Zack Williams7468c362018-04-06 09:52:30 -0700103 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700104 submodule-timeout: '{submodule-timeout}'
Zack Williams7468c362018-04-06 09:52:30 -0700105 choosing-strategy: gerrit
106 jenkins-ssh-credential: '{jenkins-ssh-credential}'
107
108 node: '{build-node}'
109 project-type: freestyle
110 concurrent: true
111
112 builders:
hwchiuf4a77ce2019-09-06 17:15:21 -0700113 - inject:
114 properties-content: |
115 SKIP_DIRS={skip-dirs}
Zack Williams7468c362018-04-06 09:52:30 -0700116 - shell: !include-raw-escape: shell/ansiblelint.sh
117
118
Zack Williams32293ee2018-05-18 09:15:13 -0700119# run `shellcheck` to validate shell scripts charts
120- job-template:
121 id: verify-shellcheck
122 name: 'verify_{project}_shellcheck'
123 description: |
124 Created by {id} job-template from ci-management/jjb/lint.yaml
125
126 triggers:
127 - cord-infra-gerrit-trigger-patchset:
128 gerrit-server-name: '{gerrit-server-name}'
129 project-regexp: '^{project}$'
130 branch-regexp: '{branch-regexp}'
131 file-include-regexp: '{all-files-regexp}'
132 dependency-jobs: '{dependency-jobs}'
133
134 properties:
135 - cord-infra-properties:
136 build-days-to-keep: '{build-days-to-keep}'
137 artifact-num-to-keep: '{artifact-num-to-keep}'
138
139 wrappers:
140 - lf-infra-wrappers:
141 build-timeout: '{build-timeout}'
142 jenkins-ssh-credential: '{jenkins-ssh-credential}'
143
144 scm:
145 - lf-infra-gerrit-scm:
146 git-url: '$GIT_URL/$GERRIT_PROJECT'
147 refspec: '$GERRIT_REFSPEC'
148 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -0700149 submodule-disable: '{submodule-disable}'
Zack Williams32293ee2018-05-18 09:15:13 -0700150 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700151 submodule-timeout: '{submodule-timeout}'
Zack Williams32293ee2018-05-18 09:15:13 -0700152 choosing-strategy: gerrit
153 jenkins-ssh-credential: '{jenkins-ssh-credential}'
154
155 node: '{build-node}'
156 project-type: freestyle
157 concurrent: true
158
159 builders:
160 - shell: !include-raw-escape: shell/shcheck.sh
Joey Armstrongaf679da2023-01-31 14:22:41 -0500161
162# [EOF]