blob: 7bcb0d709b4d686a5d3834f338651e7471a3f666 [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'
75 description: |
Zack Williams92f9b1f2018-04-11 09:58:49 -070076 Created by verify-ansible-lint job-template from ci-management/jjb/lint.yaml
Zack Williams7468c362018-04-06 09:52:30 -070077
78 triggers:
79 - cord-infra-gerrit-trigger-patchset:
80 gerrit-server-name: '{gerrit-server-name}'
81 project-regexp: '^{project}$'
82 branch-regexp: '{branch-regexp}'
Zack Williamsc27ca2d2018-04-11 13:16:45 -070083 file-include-regexp: '{all-files-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070084 dependency-jobs: '{dependency-jobs}'
85
86 properties:
87 - cord-infra-properties:
88 build-days-to-keep: '{build-days-to-keep}'
89 artifact-num-to-keep: '{artifact-num-to-keep}'
90
91 wrappers:
92 - lf-infra-wrappers:
93 build-timeout: '{build-timeout}'
94 jenkins-ssh-credential: '{jenkins-ssh-credential}'
95
96 scm:
97 - lf-infra-gerrit-scm:
98 git-url: '$GIT_URL/$GERRIT_PROJECT'
99 refspec: '$GERRIT_REFSPEC'
100 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -0700101 submodule-disable: '{submodule-disable}'
Zack Williams7468c362018-04-06 09:52:30 -0700102 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700103 submodule-timeout: '{submodule-timeout}'
Zack Williams7468c362018-04-06 09:52:30 -0700104 choosing-strategy: gerrit
105 jenkins-ssh-credential: '{jenkins-ssh-credential}'
106
107 node: '{build-node}'
108 project-type: freestyle
109 concurrent: true
110
111 builders:
hwchiuf4a77ce2019-09-06 17:15:21 -0700112 - inject:
113 properties-content: |
114 SKIP_DIRS={skip-dirs}
Zack Williams7468c362018-04-06 09:52:30 -0700115 - shell: !include-raw-escape: shell/ansiblelint.sh
116
117
Zack Williams32293ee2018-05-18 09:15:13 -0700118# run `shellcheck` to validate shell scripts charts
119- job-template:
120 id: verify-shellcheck
121 name: 'verify_{project}_shellcheck'
122 description: |
123 Created by {id} job-template from ci-management/jjb/lint.yaml
124
125 triggers:
126 - cord-infra-gerrit-trigger-patchset:
127 gerrit-server-name: '{gerrit-server-name}'
128 project-regexp: '^{project}$'
129 branch-regexp: '{branch-regexp}'
130 file-include-regexp: '{all-files-regexp}'
131 dependency-jobs: '{dependency-jobs}'
132
133 properties:
134 - cord-infra-properties:
135 build-days-to-keep: '{build-days-to-keep}'
136 artifact-num-to-keep: '{artifact-num-to-keep}'
137
138 wrappers:
139 - lf-infra-wrappers:
140 build-timeout: '{build-timeout}'
141 jenkins-ssh-credential: '{jenkins-ssh-credential}'
142
143 scm:
144 - lf-infra-gerrit-scm:
145 git-url: '$GIT_URL/$GERRIT_PROJECT'
146 refspec: '$GERRIT_REFSPEC'
147 branch: '$GERRIT_BRANCH'
Zack Williamsccc14742020-01-22 13:15:59 -0700148 submodule-disable: '{submodule-disable}'
Zack Williams32293ee2018-05-18 09:15:13 -0700149 submodule-recursive: 'false'
Zack Williamsccc14742020-01-22 13:15:59 -0700150 submodule-timeout: '{submodule-timeout}'
Zack Williams32293ee2018-05-18 09:15:13 -0700151 choosing-strategy: gerrit
152 jenkins-ssh-credential: '{jenkins-ssh-credential}'
153
154 node: '{build-node}'
155 project-type: freestyle
156 concurrent: true
157
158 builders:
159 - shell: !include-raw-escape: shell/shcheck.sh
Joey Armstrongaf679da2023-01-31 14:22:41 -0500160
161# [EOF]