blob: 62d0ce486d0dac6acfa335e05553182d2b710cad [file] [log] [blame]
Zack Williams7468c362018-04-06 09:52:30 -07001---
2# CORD lint and static code validation job templates
Zack Williams92f9b1f2018-04-11 09:58:49 -07003# These are invoked by the per-git-repo jobs stored in verify/
Zack Williams7468c362018-04-06 09:52:30 -07004
5# Verify that there is valid license/copyright on files
6- job-template:
7 id: verify-licensed
Zack Williams92f9b1f2018-04-11 09:58:49 -07008 name: 'verify_{project}_licensed'
9 description: |
Zack Williams92f9b1f2018-04-11 09:58:49 -070010 Created by verify-licensed job-template from ci-management/jjb/lint.yaml
Zack Williams7468c362018-04-06 09:52:30 -070011
12 triggers:
13 - cord-infra-gerrit-trigger-patchset:
14 gerrit-server-name: '{gerrit-server-name}'
15 project-regexp: '^{project}$'
16 branch-regexp: '{branch-regexp}'
Zack Williamsc27ca2d2018-04-11 13:16:45 -070017 file-include-regexp: '{all-files-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070018 dependency-jobs: '{dependency-jobs}'
19
20 properties:
21 - cord-infra-properties:
22 build-days-to-keep: '{build-days-to-keep}'
23 artifact-num-to-keep: '{artifact-num-to-keep}'
24
25 wrappers:
26 - lf-infra-wrappers:
27 build-timeout: '{build-timeout}'
28 jenkins-ssh-credential: '{jenkins-ssh-credential}'
29
30 scm:
31 - lf-infra-gerrit-scm:
32 git-url: '$GIT_URL/$GERRIT_PROJECT'
33 refspec: '$GERRIT_REFSPEC'
34 branch: '$GERRIT_BRANCH'
35 submodule-recursive: 'false'
36 choosing-strategy: gerrit
37 jenkins-ssh-credential: '{jenkins-ssh-credential}'
38
39 node: '{build-node}'
40 project-type: freestyle
41 concurrent: true
42
43 builders:
44 - shell: !include-raw-escape: shell/licensecheck.sh
45
46
47# run `ansible-lint` to validate ansible playbooks/roles
48- job-template:
49 id: verify-ansible-lint
Zack Williams92f9b1f2018-04-11 09:58:49 -070050 name: 'verify_{project}_ansible-lint'
51 description: |
Zack Williams92f9b1f2018-04-11 09:58:49 -070052 Created by verify-ansible-lint job-template from ci-management/jjb/lint.yaml
Zack Williams7468c362018-04-06 09:52:30 -070053
54 triggers:
55 - cord-infra-gerrit-trigger-patchset:
56 gerrit-server-name: '{gerrit-server-name}'
57 project-regexp: '^{project}$'
58 branch-regexp: '{branch-regexp}'
Zack Williamsc27ca2d2018-04-11 13:16:45 -070059 file-include-regexp: '{all-files-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070060 dependency-jobs: '{dependency-jobs}'
61
62 properties:
63 - cord-infra-properties:
64 build-days-to-keep: '{build-days-to-keep}'
65 artifact-num-to-keep: '{artifact-num-to-keep}'
66
67 wrappers:
68 - lf-infra-wrappers:
69 build-timeout: '{build-timeout}'
70 jenkins-ssh-credential: '{jenkins-ssh-credential}'
71
72 scm:
73 - lf-infra-gerrit-scm:
74 git-url: '$GIT_URL/$GERRIT_PROJECT'
75 refspec: '$GERRIT_REFSPEC'
76 branch: '$GERRIT_BRANCH'
77 submodule-recursive: 'false'
78 choosing-strategy: gerrit
79 jenkins-ssh-credential: '{jenkins-ssh-credential}'
80
81 node: '{build-node}'
82 project-type: freestyle
83 concurrent: true
84
85 builders:
86 - shell: !include-raw-escape: shell/ansiblelint.sh
87
88
89# run `helm lint --strict` to validate helm charts
90- job-template:
91 id: verify-helm-lint
Zack Williams92f9b1f2018-04-11 09:58:49 -070092 name: 'verify_{project}_helm-lint'
93 description: |
Zack Williams92f9b1f2018-04-11 09:58:49 -070094 Created by verify-helm-lint job-template from ci-management/jjb/lint.yaml
Zack Williams7468c362018-04-06 09:52:30 -070095
96 triggers:
97 - cord-infra-gerrit-trigger-patchset:
98 gerrit-server-name: '{gerrit-server-name}'
99 project-regexp: '^{project}$'
100 branch-regexp: '{branch-regexp}'
Zack Williamsc27ca2d2018-04-11 13:16:45 -0700101 file-include-regexp: '{all-files-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -0700102 dependency-jobs: '{dependency-jobs}'
103
104 properties:
105 - cord-infra-properties:
106 build-days-to-keep: '{build-days-to-keep}'
107 artifact-num-to-keep: '{artifact-num-to-keep}'
108
109 wrappers:
110 - lf-infra-wrappers:
111 build-timeout: '{build-timeout}'
112 jenkins-ssh-credential: '{jenkins-ssh-credential}'
113
114 scm:
115 - lf-infra-gerrit-scm:
116 git-url: '$GIT_URL/$GERRIT_PROJECT'
117 refspec: '$GERRIT_REFSPEC'
118 branch: '$GERRIT_BRANCH'
119 submodule-recursive: 'false'
120 choosing-strategy: gerrit
121 jenkins-ssh-credential: '{jenkins-ssh-credential}'
122
123 node: '{build-node}'
124 project-type: freestyle
125 concurrent: true
126
127 builders:
Zack Williams61f01112018-05-15 15:57:42 -0700128 - shell: |
Zack Williams82a8da42018-08-20 11:11:12 -0700129 #!/usr/bin/env bash
130 set -eu -o pipefail
131
Zack Williams61f01112018-05-15 15:57:42 -0700132 helm init --client-only
133 helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
Zack Williamsb557a212018-08-17 14:53:10 -0700134 helm repo add rook-beta https://charts.rook.io/beta
Luca Preteae7fc492018-12-13 16:00:37 -0800135 helm repo add cord https://charts.opencord.org
Zack Williams61f01112018-05-15 15:57:42 -0700136
Luca Prete2ae90132018-12-13 17:14:01 -0800137 git clone https://gerrit.opencord.org/helm-repo-tools
138 ./helm-repo-tools/helmlint.sh clean
Zack Williams32293ee2018-05-18 09:15:13 -0700139
140
141# run `shellcheck` to validate shell scripts charts
142- job-template:
143 id: verify-shellcheck
144 name: 'verify_{project}_shellcheck'
145 description: |
146 Created by {id} job-template from ci-management/jjb/lint.yaml
147
148 triggers:
149 - cord-infra-gerrit-trigger-patchset:
150 gerrit-server-name: '{gerrit-server-name}'
151 project-regexp: '^{project}$'
152 branch-regexp: '{branch-regexp}'
153 file-include-regexp: '{all-files-regexp}'
154 dependency-jobs: '{dependency-jobs}'
155
156 properties:
157 - cord-infra-properties:
158 build-days-to-keep: '{build-days-to-keep}'
159 artifact-num-to-keep: '{artifact-num-to-keep}'
160
161 wrappers:
162 - lf-infra-wrappers:
163 build-timeout: '{build-timeout}'
164 jenkins-ssh-credential: '{jenkins-ssh-credential}'
165
166 scm:
167 - lf-infra-gerrit-scm:
168 git-url: '$GIT_URL/$GERRIT_PROJECT'
169 refspec: '$GERRIT_REFSPEC'
170 branch: '$GERRIT_BRANCH'
171 submodule-recursive: 'false'
172 choosing-strategy: gerrit
173 jenkins-ssh-credential: '{jenkins-ssh-credential}'
174
175 node: '{build-node}'
176 project-type: freestyle
177 concurrent: true
178
179 builders:
180 - shell: !include-raw-escape: shell/shcheck.sh