Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 1 | --- |
| 2 | # Copyright © 2021 Orange |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | stages: |
| 16 | - linting |
| 17 | - build |
| 18 | - test |
| 19 | |
| 20 | cla_authors: |
| 21 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 22 | image: |
| 23 | name: bitnami/git:2 |
| 24 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 25 | script: |
| 26 | - . .ci/common.sh |
| 27 | - title "Running cla authors retrieval..." |
| 28 | - exit_code=0 |
| 29 | - RESULT=$(.ci/check-cla-for-multiple-commits.sh 2>&1) || exit_code=$? |
| 30 | - handle_test_result $exit_code "$RESULT" |
| 31 | - exit $exit_code |
| 32 | needs: [] |
| 33 | rules: |
| 34 | - if: $CI_MERGE_REQUEST_ID |
| 35 | |
| 36 | |
| 37 | pylint: |
| 38 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 39 | image: |
| 40 | name: cytopia/pylint |
| 41 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 42 | script: |
| 43 | - . .ci/common.sh |
| 44 | - title "Running pylint check..." |
| 45 | - exit_code=0 |
| 46 | - RESULT=$(find kubernetes/ TOSCA/ docs/ -name '*.py' -print0 | xargs -0 pylint 2>&1) || exit_code=$? |
| 47 | - handle_test_result $exit_code "$RESULT" |
| 48 | - exit $exit_code |
| 49 | needs: [] |
| 50 | rules: |
| 51 | - if: $CI_MERGE_REQUEST_ID |
| 52 | changes: |
| 53 | - .ci/* |
| 54 | - .gitlab-ci.yml |
| 55 | - '**/*.py' |
| 56 | |
| 57 | commit-message: |
| 58 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 59 | image: |
| 60 | name: jorisroovers/gitlint:0.16.0 |
| 61 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 62 | script: |
| 63 | - . .ci/common.sh |
| 64 | - title "*** Running gitlint..." |
| 65 | - exit_code=0 |
| 66 | - RESULT=$(gitlint 2>&1) || exit_code=$? |
| 67 | - handle_test_result $exit_code "$RESULT" |
| 68 | - exit $exit_code |
| 69 | needs: [] |
| 70 | rules: |
| 71 | - if: $CI_MERGE_REQUEST_ID |
| 72 | |
| 73 | |
| 74 | trailing-whitespaces: |
| 75 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 76 | image: |
| 77 | name: alpine/git:v2.24.1 |
| 78 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 79 | script: |
| 80 | - . .ci/common.sh |
| 81 | - title "Running trailing whitespaces check..." |
| 82 | - exit_code=0 |
| 83 | - RESULT=$(.ci/find-trailing-whitespaces.sh 2>&1) || exit_code=$? |
| 84 | - handle_test_result $exit_code "$RESULT" |
| 85 | - exit $exit_code |
| 86 | needs: [] |
| 87 | rules: |
| 88 | - if: $CI_MERGE_REQUEST_ID |
| 89 | |
| 90 | tabs: |
| 91 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 92 | image: |
| 93 | name: alpine/git:v2.24.1 |
| 94 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 95 | script: |
| 96 | - . .ci/common.sh |
| 97 | - title "Running tabs check..." |
| 98 | - exit_code=0 |
| 99 | - RESULT=$(.ci/find-tabs.sh 2>&1) || exit_code=$? |
| 100 | - handle_test_result $exit_code "$RESULT" |
| 101 | - exit $exit_code |
| 102 | needs: [] |
| 103 | rules: |
| 104 | - if: $CI_MERGE_REQUEST_ID |
| 105 | |
| 106 | documentation:doc8: |
| 107 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 108 | image: |
| 109 | name: testthedocs/ttd-doc8 |
| 110 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 111 | script: |
| 112 | - . .ci/common.sh |
| 113 | - title "Running doc8 check..." |
| 114 | - exit_code=0 |
| 115 | - RESULT=$(doc8 docs 2>&1) || exit_code=$? |
| 116 | - handle_test_result $exit_code "$RESULT" |
| 117 | - exit $exit_code |
| 118 | rules: |
| 119 | - if: $CI_MERGE_REQUEST_ID |
| 120 | changes: |
| 121 | - .ci/* |
| 122 | - .gitlab-ci.yml |
| 123 | - docs/**/* |
| 124 | needs: [] |
| 125 | |
| 126 | documentation:link-check: |
| 127 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 128 | image: |
| 129 | name: python:3.7 |
| 130 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 131 | script: |
| 132 | - . .ci/common.sh |
| 133 | - pip install -r requirements.txt |
| 134 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt |
| 135 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
| 136 | - title "Running documentation links check..." |
| 137 | - exit_code=0 |
| 138 | - RESULT=$(sphinx-build -W -b linkcheck -d /tmp/doctrees ./docs/ ./docs/_build/linkcheck 2>&1) || exit_code=$? |
| 139 | - handle_test_result $exit_code "$RESULT" |
| 140 | - exit $exit_code |
| 141 | rules: |
| 142 | - if: $CI_MERGE_REQUEST_ID |
| 143 | changes: |
| 144 | - .ci/* |
| 145 | - .gitlab-ci.yml |
| 146 | - docs/**/* |
| 147 | needs: [] |
| 148 | |
| 149 | documentation:spelling: |
| 150 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 151 | image: |
| 152 | name: python:3.7 |
| 153 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 154 | script: |
| 155 | - . .ci/common.sh |
| 156 | - apt-get update |
| 157 | - apt-get install -qq --yes curl libenchant-2-2 |
| 158 | - curl -LO https://git.onap.org/doc/plain/docs/spelling_wordlist.txt |
| 159 | - pip install -r requirements.txt |
| 160 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt |
| 161 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
| 162 | - title "Running documentation spelling check..." |
| 163 | - exit_code=0 |
| 164 | - RESULT=$(sphinx-build -b spelling -d /tmp/doctrees ./docs/ ./docs/_build/spelling 2>&1) || exit_code=$? |
| 165 | - handle_test_result $exit_code "$RESULT" |
| 166 | - exit $exit_code |
| 167 | rules: |
| 168 | - if: $CI_MERGE_REQUEST_ID |
| 169 | changes: |
| 170 | - .ci/* |
| 171 | - .gitlab-ci.yml |
| 172 | - docs/**/* |
| 173 | needs: [] |
| 174 | |
| 175 | bashisms: |
| 176 | stage: linting |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 177 | image: |
| 178 | name: manabu/checkbashisms-docker |
| 179 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 180 | script: |
| 181 | - . .ci/common.sh |
| 182 | - title "Running bashisms check..." |
| 183 | - exit_code=0 |
| 184 | - RESULT=$(.ci/check-bashisms 2>&1) || exit_code=$? |
| 185 | - handle_test_result $exit_code "$RESULT" |
| 186 | - exit $exit_code |
| 187 | rules: |
| 188 | - if: $CI_MERGE_REQUEST_ID |
| 189 | needs: [] |
| 190 | |
| 191 | helm:fast: |
| 192 | stage: linting |
| 193 | services: |
| 194 | - name: bitnami/chartmuseum:latest |
| 195 | alias: chartmuseum |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 196 | image: |
| 197 | name: alpine/helm:3.6.3 |
| 198 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 199 | variables: |
| 200 | SKIP_LINT: "TRUE" |
| 201 | script: |
| 202 | - . .ci/common.sh |
| 203 | - apk add --no-cache make |
| 204 | - helm repo add local http://chartmuseum:8080/ |
| 205 | - helm plugin install --version v0.9.0 https://github.com/chartmuseum/helm-push.git |
| 206 | - title "Running helm fast check..." |
| 207 | - cd kubernetes |
| 208 | - exit_code=0 |
| 209 | - make all || exit_code=$? |
| 210 | - handle_test_result $exit_code "" |
| 211 | - exit $exit_code |
| 212 | needs: [] |
| 213 | rules: |
| 214 | - if: $CI_MERGE_REQUEST_ID |
| 215 | changes: |
| 216 | - .ci/* |
| 217 | - .gitlab-ci.yml |
| 218 | - kubernetes/**/* |
| 219 | |
| 220 | helm:full: |
| 221 | stage: build |
| 222 | services: |
| 223 | - name: bitnami/chartmuseum:latest |
| 224 | alias: chartmuseum |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 225 | image: |
| 226 | name: alpine/helm:3.6.3 |
| 227 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 228 | script: |
| 229 | - . .ci/common.sh |
| 230 | - apk add --no-cache make |
| 231 | - helm repo add local http://chartmuseum:8080/ |
| 232 | - helm plugin install --version v0.9.0 https://github.com/chartmuseum/helm-push.git |
| 233 | - title "Running full helm check..." |
| 234 | - cd kubernetes |
| 235 | - exit_code=0 |
| 236 | - make all || exit_code=$? |
| 237 | - handle_test_result $exit_code "" |
| 238 | - exit $exit_code |
| 239 | needs: |
| 240 | - helm:fast |
| 241 | timeout: 6h |
| 242 | rules: |
| 243 | - if: $CI_MERGE_REQUEST_ID |
| 244 | changes: |
| 245 | - .ci/* |
| 246 | - .gitlab-ci.yml |
| 247 | - kubernetes/**/* |
| 248 | |
| 249 | documentation: |
| 250 | stage: build |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 251 | image: |
| 252 | name: python:3.7 |
| 253 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 254 | script: |
| 255 | - . .ci/common.sh |
| 256 | - apt-get update |
| 257 | - apt-get install --yes graphviz plantuml |
| 258 | - pip install -r requirements.txt |
| 259 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt |
| 260 | -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt |
| 261 | - title "Running documentation build..." |
| 262 | - exit_code=0 |
| 263 | - RESULT=$(sphinx-build -q -W -b html -d /tmp/doctrees ./docs/ ./docs/_build/html 2>&1) || exit_code=$? |
| 264 | - handle_test_result $exit_code "$RESULT" |
| 265 | - exit $exit_code |
| 266 | rules: |
| 267 | - if: $CI_MERGE_REQUEST_ID |
| 268 | changes: |
| 269 | - .ci/* |
| 270 | - .gitlab-ci.yml |
| 271 | - docs/* |
| 272 | needs: |
| 273 | - documentation:spelling |
| 274 | - documentation:link-check |
| 275 | - documentation:doc8 |
| 276 | |
| 277 | gating:launch: |
| 278 | stage: test |
rope252 | a29a4d7 | 2022-01-06 19:46:51 +0000 | [diff] [blame] | 279 | image: |
| 280 | name: busybox |
| 281 | entrypoint: [""] |
Sylvain Desbureaux | d035a0a | 2021-12-08 12:59:32 +0100 | [diff] [blame] | 282 | script: |
| 283 | - . .ci/common.sh |
| 284 | - title "Launching request for a gate" |
| 285 | needs: |
| 286 | - bashisms |
| 287 | - helm:fast |
| 288 | - tabs |
| 289 | - trailing-whitespaces |
| 290 | rules: |
| 291 | - if: $CI_MERGE_REQUEST_ID |
| 292 | changes: |
| 293 | - .ci/* |
| 294 | - .gitlab-ci.yml |
| 295 | - kubernetes/**/* |