Saltstack Official UFW Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

.gitlab-ci.yml 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. # -*- coding: utf-8 -*-
  2. # vim: ft=yaml
  3. ---
  4. ###############################################################################
  5. # Define all YAML node anchors
  6. ###############################################################################
  7. .node_anchors:
  8. # `only` (also used for `except` where applicable)
  9. only_branch_master_parent_repo: &only_branch_master_parent_repo
  10. - 'master@saltstack-formulas/ufw-formula'
  11. # `stage`
  12. stage_lint: &stage_lint 'lint'
  13. stage_release: &stage_release 'release'
  14. stage_test: &stage_test 'test'
  15. # `image`
  16. image_commitlint: &image_commitlint 'myii/ssf-commitlint:11'
  17. image_dindruby: &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3'
  18. image_precommit: &image_precommit
  19. name: 'myii/ssf-pre-commit:2.9.2'
  20. entrypoint: ['/bin/bash', '-c']
  21. image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest'
  22. image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14'
  23. # `services`
  24. services_docker_dind: &services_docker_dind
  25. - 'docker:dind'
  26. # `variables`
  27. # https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
  28. # https://bundler.io/v1.16/bundle_config.html
  29. variables_bundler: &variables_bundler
  30. BUNDLE_CACHE_PATH: '${CI_PROJECT_DIR}/.cache/bundler'
  31. BUNDLE_WITHOUT: 'production'
  32. # `cache`
  33. cache_bundler: &cache_bundler
  34. key: '${CI_JOB_STAGE}'
  35. paths:
  36. - '${BUNDLE_CACHE_PATH}'
  37. ###############################################################################
  38. # Define stages and global variables
  39. ###############################################################################
  40. stages:
  41. - *stage_lint
  42. - *stage_test
  43. - *stage_release
  44. variables:
  45. DOCKER_DRIVER: 'overlay2'
  46. ###############################################################################
  47. # `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed)
  48. ###############################################################################
  49. commitlint:
  50. stage: *stage_lint
  51. image: *image_commitlint
  52. script:
  53. # Add `upstream` remote to get access to `upstream/master`
  54. - 'git remote add upstream
  55. https://gitlab.com/saltstack-formulas/ufw-formula.git'
  56. - 'git fetch --all'
  57. # Set default commit hashes for `--from` and `--to`
  58. - 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
  59. - 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
  60. # `coqbot` adds a merge commit to test PRs on top of the latest commit in
  61. # the repo; amend this merge commit message to avoid failure
  62. - |
  63. if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
  64. && [ "${CI_COMMIT_BRANCH}" != "master" ]; then
  65. git commit --amend -m \
  66. 'chore: reword coqbot merge commit message for commitlint'
  67. export COMMITLINT_TO=HEAD
  68. fi
  69. # Run `commitlint`
  70. - 'commitlint --from "${COMMITLINT_FROM}"
  71. --to "${COMMITLINT_TO}"
  72. --verbose'
  73. pre-commit:
  74. stage: *stage_lint
  75. image: *image_precommit
  76. # https://pre-commit.com/#gitlab-ci-example
  77. variables:
  78. PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit'
  79. cache:
  80. key: '${CI_JOB_NAME}'
  81. paths:
  82. - '${PRE_COMMIT_HOME}'
  83. script:
  84. - 'pre-commit run --all-files --color always --verbose'
  85. # Use a separate job for `rubocop` other than the one potentially run by `pre-commit`
  86. # - The `pre-commit` check will only be available for formulas that pass the default
  87. # `rubocop` check -- and must continue to do so
  88. # - This job is allowed to fail, so can be used for all formulas
  89. # - Furthermore, this job uses all of the latest `rubocop` features & cops,
  90. # which will help when upgrading the `rubocop` linter used in `pre-commit`
  91. rubocop:
  92. allow_failure: true
  93. stage: *stage_lint
  94. image: *image_rubocop
  95. script:
  96. - 'rubocop -d -P -S --enable-pending-cops'
  97. ###############################################################################
  98. # Define `test` template
  99. ###############################################################################
  100. .test_instance: &test_instance
  101. stage: *stage_test
  102. image: *image_dindruby
  103. services: *services_docker_dind
  104. variables: *variables_bundler
  105. cache: *cache_bundler
  106. before_script:
  107. # TODO: This should work from the env vars above automatically
  108. - 'bundle config set path "${BUNDLE_CACHE_PATH}"'
  109. - 'bundle config set without "${BUNDLE_WITHOUT}"'
  110. - 'bundle install'
  111. script:
  112. # Alternative value to consider: `${CI_JOB_NAME}`
  113. - 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
  114. ###############################################################################
  115. # Define `test` template (`allow_failure: true`)
  116. ###############################################################################
  117. .test_instance_failure_permitted:
  118. <<: *test_instance
  119. allow_failure: true
  120. ###############################################################################
  121. # `test` stage: each instance below uses the `test` template above
  122. ###############################################################################
  123. ## Define the rest of the matrix based on Kitchen testing
  124. # Make sure the instances listed below match up with
  125. # the `platforms` defined in `kitchen.yml`
  126. # default-debian-11-tiamat-py3: {extends: '.test_instance'}
  127. # default-debian-10-tiamat-py3: {extends: '.test_instance'}
  128. # without-ipv6-debian-9-tiamat-py3: {extends: '.test_instance'}
  129. # without-ipv6-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
  130. # without-ipv6-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
  131. # default-centos-stream8-tiamat-py3: {extends: '.test_instance_failure_permitted'}
  132. # default-centos-8-tiamat-py3: {extends: '.test_instance'}
  133. # without-ipv6-centos-7-tiamat-py3: {extends: '.test_instance'}
  134. # without-ipv6-amazonlinux-2-tiamat-py3: {extends: '.test_instance'}
  135. # default-oraclelinux-8-tiamat-py3: {extends: '.test_instance'}
  136. # without-ipv6-oraclelinux-7-tiamat-py3: {extends: '.test_instance'}
  137. # default-almalinux-8-tiamat-py3: {extends: '.test_instance'}
  138. # default-rockylinux-8-tiamat-py3: {extends: '.test_instance'}
  139. default-debian-11-master-py3: {extends: '.test_instance'}
  140. # without-ipv6-debian-11-master-py3: {extends: '.test_instance'}
  141. default-debian-10-master-py3: {extends: '.test_instance'}
  142. # without-ipv6-debian-10-master-py3: {extends: '.test_instance'}
  143. without-ipv6-debian-9-master-py3: {extends: '.test_instance'}
  144. without-ipv6-ubuntu-2004-master-py3: {extends: '.test_instance'}
  145. without-ipv6-ubuntu-1804-master-py3: {extends: '.test_instance'}
  146. default-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'}
  147. # without-ipv6-centos-stream8-master-py3: {extends: '.test_instance_failure_permitted'}
  148. default-centos-8-master-py3: {extends: '.test_instance'}
  149. # without-ipv6-centos-8-master-py3: {extends: '.test_instance'}
  150. without-ipv6-centos-7-master-py3: {extends: '.test_instance'}
  151. without-ipv6-fedora-34-master-py3: {extends: '.test_instance'}
  152. without-ipv6-fedora-33-master-py3: {extends: '.test_instance'}
  153. without-ipv6-opensuse-leap-153-master-py3: {extends: '.test_instance'}
  154. without-ipv6-opensuse-leap-152-master-py3: {extends: '.test_instance'}
  155. # without-ipv6-opensuse-tmbl-latest-master-py3: {extends: '.test_instance_failure_permitted'}
  156. without-ipv6-amazonlinux-2-master-py3: {extends: '.test_instance'}
  157. default-oraclelinux-8-master-py3: {extends: '.test_instance'}
  158. # without-ipv6-oraclelinux-8-master-py3: {extends: '.test_instance'}
  159. without-ipv6-oraclelinux-7-master-py3: {extends: '.test_instance'}
  160. without-ipv6-arch-base-latest-master-py3: {extends: '.test_instance'}
  161. without-ipv6-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
  162. without-ipv6-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
  163. default-almalinux-8-master-py3: {extends: '.test_instance'}
  164. # without-ipv6-almalinux-8-master-py3: {extends: '.test_instance'}
  165. default-rockylinux-8-master-py3: {extends: '.test_instance'}
  166. # without-ipv6-rockylinux-8-master-py3: {extends: '.test_instance'}
  167. # default-debian-11-3004-0-py3: {extends: '.test_instance'}
  168. # default-debian-10-3004-0-py3: {extends: '.test_instance'}
  169. # without-ipv6-debian-9-3004-0-py3: {extends: '.test_instance'}
  170. # without-ipv6-ubuntu-2004-3004-0-py3: {extends: '.test_instance'}
  171. # without-ipv6-ubuntu-1804-3004-0-py3: {extends: '.test_instance'}
  172. # default-centos-stream8-3004-0-py3: {extends: '.test_instance_failure_permitted'}
  173. # default-centos-8-3004-0-py3: {extends: '.test_instance'}
  174. # without-ipv6-centos-7-3004-0-py3: {extends: '.test_instance'}
  175. # without-ipv6-fedora-34-3004-0-py3: {extends: '.test_instance'}
  176. # without-ipv6-fedora-33-3004-0-py3: {extends: '.test_instance'}
  177. # without-ipv6-opensuse-leap-153-3004-0-py3: {extends: '.test_instance'}
  178. # without-ipv6-opensuse-leap-152-3004-0-py3: {extends: '.test_instance'}
  179. # without-ipv6-opensuse-tmbl-latest-3004-0-py3: {extends: '.test_instance_failure_permitted'}
  180. # without-ipv6-amazonlinux-2-3004-0-py3: {extends: '.test_instance'}
  181. # default-oraclelinux-8-3004-0-py3: {extends: '.test_instance'}
  182. # without-ipv6-oraclelinux-7-3004-0-py3: {extends: '.test_instance'}
  183. # without-ipv6-arch-base-latest-3004-0-py3: {extends: '.test_instance'}
  184. # without-ipv6-gentoo-stage3-latest-3004-0-py3: {extends: '.test_instance'}
  185. # without-ipv6-gentoo-stage3-systemd-3004-0-py3: {extends: '.test_instance'}
  186. # default-almalinux-8-3004-0-py3: {extends: '.test_instance'}
  187. # default-rockylinux-8-3004-0-py3: {extends: '.test_instance'}
  188. # default-debian-11-3003-3-py3: {extends: '.test_instance'}
  189. # default-debian-10-3003-3-py3: {extends: '.test_instance'}
  190. # without-ipv6-debian-9-3003-3-py3: {extends: '.test_instance'}
  191. # without-ipv6-ubuntu-2004-3003-3-py3: {extends: '.test_instance'}
  192. # without-ipv6-ubuntu-1804-3003-3-py3: {extends: '.test_instance'}
  193. # default-centos-stream8-3003-3-py3: {extends: '.test_instance_failure_permitted'}
  194. # default-centos-8-3003-3-py3: {extends: '.test_instance'}
  195. # without-ipv6-centos-7-3003-3-py3: {extends: '.test_instance'}
  196. # without-ipv6-fedora-34-3003-3-py3: {extends: '.test_instance'}
  197. # without-ipv6-fedora-33-3003-3-py3: {extends: '.test_instance'}
  198. # without-ipv6-opensuse-leap-153-3003-3-py3: {extends: '.test_instance'}
  199. # without-ipv6-opensuse-leap-152-3003-3-py3: {extends: '.test_instance'}
  200. # without-ipv6-opensuse-tmbl-latest-3003-3-py3: {extends: '.test_instance_failure_permitted'}
  201. # without-ipv6-amazonlinux-2-3003-3-py3: {extends: '.test_instance'}
  202. # default-oraclelinux-8-3003-3-py3: {extends: '.test_instance'}
  203. # without-ipv6-oraclelinux-7-3003-3-py3: {extends: '.test_instance'}
  204. # without-ipv6-arch-base-latest-3003-3-py3: {extends: '.test_instance'}
  205. # without-ipv6-gentoo-stage3-latest-3003-3-py3: {extends: '.test_instance'}
  206. # without-ipv6-gentoo-stage3-systemd-3003-3-py3: {extends: '.test_instance'}
  207. # default-almalinux-8-3003-3-py3: {extends: '.test_instance'}
  208. # default-debian-11-3002-7-py3: {extends: '.test_instance'}
  209. # default-debian-10-3002-7-py3: {extends: '.test_instance'}
  210. # without-ipv6-debian-9-3002-7-py3: {extends: '.test_instance'}
  211. # without-ipv6-ubuntu-2004-3002-7-py3: {extends: '.test_instance'}
  212. # without-ipv6-ubuntu-1804-3002-7-py3: {extends: '.test_instance'}
  213. # default-centos-8-3002-7-py3: {extends: '.test_instance'}
  214. # without-ipv6-centos-7-3002-7-py3: {extends: '.test_instance'}
  215. # without-ipv6-fedora-34-3002-7-py3: {extends: '.test_instance'}
  216. # without-ipv6-fedora-33-3002-7-py3: {extends: '.test_instance'}
  217. # without-ipv6-opensuse-leap-153-3002-7-py3: {extends: '.test_instance'}
  218. # without-ipv6-opensuse-leap-152-3002-7-py3: {extends: '.test_instance'}
  219. # without-ipv6-opensuse-tmbl-latest-3002-7-py3: {extends: '.test_instance_failure_permitted'}
  220. # without-ipv6-amazonlinux-2-3002-7-py3: {extends: '.test_instance'}
  221. # default-oraclelinux-8-3002-7-py3: {extends: '.test_instance'}
  222. # without-ipv6-oraclelinux-7-3002-7-py3: {extends: '.test_instance'}
  223. # without-ipv6-arch-base-latest-3002-7-py3: {extends: '.test_instance'}
  224. # without-ipv6-gentoo-stage3-latest-3002-7-py3: {extends: '.test_instance'}
  225. # without-ipv6-gentoo-stage3-systemd-3002-7-py3: {extends: '.test_instance'}
  226. # default-debian-10-3001-8-py3: {extends: '.test_instance'}
  227. # without-ipv6-debian-9-3001-8-py3: {extends: '.test_instance'}
  228. # without-ipv6-ubuntu-2004-3001-8-py3: {extends: '.test_instance'}
  229. # without-ipv6-ubuntu-1804-3001-8-py3: {extends: '.test_instance'}
  230. # default-centos-8-3001-8-py3: {extends: '.test_instance'}
  231. # without-ipv6-centos-7-3001-8-py3: {extends: '.test_instance'}
  232. # without-ipv6-fedora-34-3001-8-py3: {extends: '.test_instance'}
  233. # without-ipv6-fedora-33-3001-8-py3: {extends: '.test_instance'}
  234. # without-ipv6-opensuse-leap-153-3001-8-py3: {extends: '.test_instance'}
  235. # without-ipv6-opensuse-leap-152-3001-8-py3: {extends: '.test_instance'}
  236. # without-ipv6-opensuse-tmbl-latest-3001-8-py3: {extends: '.test_instance_failure_permitted'}
  237. # without-ipv6-amazonlinux-2-3001-8-py3: {extends: '.test_instance'}
  238. # default-oraclelinux-8-3001-8-py3: {extends: '.test_instance'}
  239. # without-ipv6-oraclelinux-7-3001-8-py3: {extends: '.test_instance'}
  240. # without-ipv6-arch-base-latest-3001-8-py3: {extends: '.test_instance'}
  241. # without-ipv6-gentoo-stage3-latest-3001-8-py3: {extends: '.test_instance'}
  242. # without-ipv6-gentoo-stage3-systemd-3001-8-py3: {extends: '.test_instance'}
  243. ###############################################################################
  244. # `release` stage: `semantic-release`
  245. ###############################################################################
  246. semantic-release:
  247. only: *only_branch_master_parent_repo
  248. stage: *stage_release
  249. image: *image_semanticrelease
  250. variables:
  251. MAINTAINER_TOKEN: '${GH_TOKEN}'
  252. script:
  253. # Update `AUTHORS.md`
  254. - '${HOME}/go/bin/maintainer contributor'
  255. # Run `semantic-release`
  256. - 'semantic-release'