Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

289 lines
14KB

  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/apache-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. # yamllint disable-line rule:line-length
  23. image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release-pandoc:15.14'
  24. # `services`
  25. services_docker_dind: &services_docker_dind
  26. - 'docker:dind'
  27. # `variables`
  28. # https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
  29. # https://bundler.io/v1.16/bundle_config.html
  30. variables_bundler: &variables_bundler
  31. BUNDLE_CACHE_PATH: '${CI_PROJECT_DIR}/.cache/bundler'
  32. BUNDLE_WITHOUT: 'production'
  33. # `cache`
  34. cache_bundler: &cache_bundler
  35. key: '${CI_JOB_STAGE}'
  36. paths:
  37. - '${BUNDLE_CACHE_PATH}'
  38. ###############################################################################
  39. # Define stages and global variables
  40. ###############################################################################
  41. stages:
  42. - *stage_lint
  43. - *stage_test
  44. - *stage_release
  45. variables:
  46. DOCKER_DRIVER: 'overlay2'
  47. ###############################################################################
  48. # `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed)
  49. ###############################################################################
  50. # commitlint:
  51. # allow_failure: true
  52. # stage: *stage_lint
  53. # image: *image_commitlint
  54. # script:
  55. # # Add `upstream` remote to get access to `upstream/master`
  56. # - 'git remote add upstream
  57. # https://gitlab.com/saltstack-formulas/apache-formula.git'
  58. # - 'git fetch --all'
  59. # # Set default commit hashes for `--from` and `--to`
  60. # - 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
  61. # - 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
  62. # # `coqbot` adds a merge commit to test PRs on top of the latest commit in
  63. # # the repo; amend this merge commit message to avoid failure
  64. # - |
  65. # if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
  66. # && [ "${CI_COMMIT_BRANCH}" != "master" ]; then
  67. # git commit --amend -m \
  68. # 'chore: reword coqbot merge commit message for commitlint'
  69. # export COMMITLINT_TO=HEAD
  70. # fi
  71. # # Run `commitlint`
  72. # - 'commitlint --from "${COMMITLINT_FROM}"
  73. # --to "${COMMITLINT_TO}"
  74. # --verbose'
  75. #
  76. # pre-commit:
  77. # allow_failure: true
  78. # stage: *stage_lint
  79. # image: *image_precommit
  80. # # https://pre-commit.com/#gitlab-ci-example
  81. # variables:
  82. # PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit'
  83. # cache:
  84. # key: '${CI_JOB_NAME}'
  85. # paths:
  86. # - '${PRE_COMMIT_HOME}'
  87. # script:
  88. # - 'pre-commit run --all-files --color always --verbose'
  89. #
  90. # # Use a separate job for `rubocop` other than the one potentially run by `pre-commit`
  91. # # - The `pre-commit` check will only be available for formulas that pass the default
  92. # # `rubocop` check -- and must continue to do so
  93. # # - This job is allowed to fail, so can be used for all formulas
  94. # # - Furthermore, this job uses all of the latest `rubocop` features & cops,
  95. # # which will help when upgrading the `rubocop` linter used in `pre-commit`
  96. # rubocop:
  97. # allow_failure: true
  98. # stage: *stage_lint
  99. # image: *image_rubocop
  100. # script:
  101. # - 'rubocop -d -P -S --enable-pending-cops'
  102. ###############################################################################
  103. # Define `test` template
  104. ###############################################################################
  105. .test_instance:
  106. stage: *stage_test
  107. image: *image_dindruby
  108. services: *services_docker_dind
  109. variables: *variables_bundler
  110. cache: *cache_bundler
  111. before_script:
  112. # TODO: This should work from the env vars above automatically
  113. - 'bundle config set path "${BUNDLE_CACHE_PATH}"'
  114. - 'bundle config set without "${BUNDLE_WITHOUT}"'
  115. - 'bundle install'
  116. # - 'bundle update --all'
  117. script:
  118. # Alternative value to consider: `${CI_JOB_NAME}`
  119. - 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
  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. # default-debian-9-tiamat-py3: {extends: '.test_instance'}
  129. # default-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
  130. # default-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
  131. # default-centos-8-tiamat-py3: {extends: '.test_instance'}
  132. # default-centos-7-tiamat-py3: {extends: '.test_instance'}
  133. # default-amazonlinux-2-tiamat-py3: {extends: '.test_instance'}
  134. # default-oraclelinux-8-tiamat-py3: {extends: '.test_instance'}
  135. # default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'}
  136. # default-almalinux-8-tiamat-py3: {extends: '.test_instance'}
  137. # default-rockylinux-8-tiamat-py3: {extends: '.test_instance'}
  138. # default-debian-11-master-py3: {extends: '.test_instance'}
  139. # modules-debian-11-master-py3: {extends: '.test_instance'}
  140. debian-11-master-py3: {extends: '.test_instance'}
  141. # default-debian-10-master-py3: {extends: '.test_instance'}
  142. # modules-debian-10-master-py3: {extends: '.test_instance'}
  143. debian-10-master-py3: {extends: '.test_instance'}
  144. # default-debian-9-master-py3: {extends: '.test_instance'}
  145. # modules-debian-9-master-py3: {extends: '.test_instance'}
  146. # debian-9-master-py3: {extends: '.test_instance'}
  147. # default-ubuntu-2004-master-py3: {extends: '.test_instance'}
  148. # modules-ubuntu-2004-master-py3: {extends: '.test_instance'}
  149. ubuntu-2004-master-py3: {extends: '.test_instance'}
  150. # default-ubuntu-1804-master-py3: {extends: '.test_instance'}
  151. # modules-ubuntu-1804-master-py3: {extends: '.test_instance'}
  152. ubuntu-1804-master-py3: {extends: '.test_instance'}
  153. # default-centos-8-master-py3: {extends: '.test_instance'}
  154. # modules-centos-8-master-py3: {extends: '.test_instance'}
  155. centos-8-master-py3: {extends: '.test_instance'}
  156. # default-centos-7-master-py3: {extends: '.test_instance'}
  157. # modules-centos-7-master-py3: {extends: '.test_instance'}
  158. centos-7-master-py3: {extends: '.test_instance'}
  159. # default-fedora-34-master-py3: {extends: '.test_instance'}
  160. # modules-fedora-34-master-py3: {extends: '.test_instance'}
  161. fedora-34-master-py3: {extends: '.test_instance'}
  162. # default-fedora-33-master-py3: {extends: '.test_instance'}
  163. # modules-fedora-33-master-py3: {extends: '.test_instance'}
  164. fedora-33-master-py3: {extends: '.test_instance'}
  165. # default-opensuse-leap-153-master-py3: {extends: '.test_instance'}
  166. # modules-opensuse-leap-153-master-py3: {extends: '.test_instance'}
  167. opensuse-leap-153-master-py3: {extends: '.test_instance'}
  168. # default-opensuse-leap-152-master-py3: {extends: '.test_instance'}
  169. # modules-opensuse-leap-152-master-py3: {extends: '.test_instance'}
  170. opensuse-leap-152-master-py3: {extends: '.test_instance'}
  171. default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
  172. # modules-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
  173. # opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
  174. # https://community.letsencrypt.org/t/localhost-crt-does-not-exist-or-is-empty/103979
  175. default-amazonlinux-2-master-py3: {extends: '.test_instance'}
  176. # modules-amazonlinux-2-master-py3: {extends: '.test_instance'}
  177. # amazonlinux-2-master-py3: {extends: '.test_instance'}
  178. # default-oraclelinux-8-master-py3: {extends: '.test_instance'}
  179. # modules-oraclelinux-8-master-py3: {extends: '.test_instance'}
  180. # oraclelinux-8-master-py3: {extends: '.test_instance'}
  181. # default-oraclelinux-7-master-py3: {extends: '.test_instance'}
  182. # modules-oraclelinux-7-master-py3: {extends: '.test_instance'}
  183. oraclelinux-7-master-py3: {extends: '.test_instance'}
  184. # default-arch-base-latest-master-py3: {extends: '.test_instance'}
  185. modules-arch-base-latest-master-py3: {extends: '.test_instance'}
  186. # arch-base-latest-master-py3: {extends: '.test_instance'}
  187. # default-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
  188. # modules-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
  189. # gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
  190. # default-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
  191. # modules-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
  192. # gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
  193. # default-almalinux-8-master-py3: {extends: '.test_instance'}
  194. # modules-almalinux-8-master-py3: {extends: '.test_instance'}
  195. almalinux-8-master-py3: {extends: '.test_instance'}
  196. # default-rockylinux-8-master-py3: {extends: '.test_instance'}
  197. # modules-rockylinux-8-master-py3: {extends: '.test_instance'}
  198. rockylinux-8-master-py3: {extends: '.test_instance'}
  199. # default-debian-11-3003-2-py3: {extends: '.test_instance'}
  200. # default-debian-10-3003-2-py3: {extends: '.test_instance'}
  201. # default-debian-9-3003-2-py3: {extends: '.test_instance'}
  202. # default-ubuntu-2004-3003-2-py3: {extends: '.test_instance'}
  203. # default-ubuntu-1804-3003-2-py3: {extends: '.test_instance'}
  204. # default-centos-8-3003-2-py3: {extends: '.test_instance'}
  205. # default-centos-7-3003-2-py3: {extends: '.test_instance'}
  206. # default-fedora-34-3003-2-py3: {extends: '.test_instance'}
  207. # default-fedora-33-3003-2-py3: {extends: '.test_instance'}
  208. # default-opensuse-leap-153-3003-2-py3: {extends: '.test_instance'}
  209. # default-opensuse-leap-152-3003-2-py3: {extends: '.test_instance'}
  210. # default-opensuse-tmbl-latest-3003-2-py3: {extends: '.test_instance'}
  211. # default-amazonlinux-2-3003-2-py3: {extends: '.test_instance'}
  212. # default-oraclelinux-8-3003-2-py3: {extends: '.test_instance'}
  213. # default-oraclelinux-7-3003-2-py3: {extends: '.test_instance'}
  214. # default-arch-base-latest-3003-2-py3: {extends: '.test_instance'}
  215. # default-gentoo-stage3-latest-3003-2-py3: {extends: '.test_instance'}
  216. # default-gentoo-stage3-systemd-3003-2-py3: {extends: '.test_instance'}
  217. # default-almalinux-8-3003-2-py3: {extends: '.test_instance'}
  218. # default-arch-base-latest-3003-1-py3: {extends: '.test_instance'}
  219. # default-gentoo-stage3-latest-3003-1-py3: {extends: '.test_instance'}
  220. # default-gentoo-stage3-systemd-3003-1-py3: {extends: '.test_instance'}
  221. # default-debian-11-3002-6-py3: {extends: '.test_instance'}
  222. # default-debian-10-3002-6-py3: {extends: '.test_instance'}
  223. # default-debian-9-3002-6-py3: {extends: '.test_instance'}
  224. # default-ubuntu-2004-3002-6-py3: {extends: '.test_instance'}
  225. # default-ubuntu-1804-3002-6-py3: {extends: '.test_instance'}
  226. # default-centos-8-3002-6-py3: {extends: '.test_instance'}
  227. # default-centos-7-3002-6-py3: {extends: '.test_instance'}
  228. # default-fedora-34-3002-6-py3: {extends: '.test_instance'}
  229. # default-fedora-33-3002-6-py3: {extends: '.test_instance'}
  230. # default-amazonlinux-2-3002-6-py3: {extends: '.test_instance'}
  231. # default-oraclelinux-8-3002-6-py3: {extends: '.test_instance'}
  232. # default-oraclelinux-7-3002-6-py3: {extends: '.test_instance'}
  233. # default-arch-base-latest-3002-6-py3: {extends: '.test_instance'}
  234. # default-gentoo-stage3-latest-3002-6-py3: {extends: '.test_instance'}
  235. # default-gentoo-stage3-systemd-3002-6-py3: {extends: '.test_instance'}
  236. # default-opensuse-leap-153-3002-2-py3: {extends: '.test_instance'}
  237. # default-opensuse-leap-152-3002-2-py3: {extends: '.test_instance'}
  238. # default-opensuse-tmbl-latest-3002-2-py3: {extends: '.test_instance'}
  239. # default-debian-10-3001-7-py3: {extends: '.test_instance'}
  240. # default-debian-9-3001-7-py3: {extends: '.test_instance'}
  241. # default-ubuntu-2004-3001-7-py3: {extends: '.test_instance'}
  242. # default-ubuntu-1804-3001-7-py3: {extends: '.test_instance'}
  243. # default-centos-8-3001-7-py3: {extends: '.test_instance'}
  244. # default-centos-7-3001-7-py3: {extends: '.test_instance'}
  245. # default-fedora-34-3001-7-py3: {extends: '.test_instance'}
  246. # default-fedora-33-3001-7-py3: {extends: '.test_instance'}
  247. # default-opensuse-leap-153-3001-7-py3: {extends: '.test_instance'}
  248. # default-opensuse-leap-152-3001-7-py3: {extends: '.test_instance'}
  249. # default-opensuse-tmbl-latest-3001-7-py3: {extends: '.test_instance'}
  250. # default-amazonlinux-2-3001-7-py3: {extends: '.test_instance'}
  251. # default-oraclelinux-8-3001-7-py3: {extends: '.test_instance'}
  252. # default-oraclelinux-7-3001-7-py3: {extends: '.test_instance'}
  253. # default-arch-base-latest-3001-7-py3: {extends: '.test_instance'}
  254. # default-gentoo-stage3-latest-3001-7-py3: {extends: '.test_instance'}
  255. # default-gentoo-stage3-systemd-3001-7-py3: {extends: '.test_instance'}
  256. # default-debian-10-3000-9-py3: {extends: '.test_instance'}
  257. # default-debian-9-3000-9-py3: {extends: '.test_instance'}
  258. # default-ubuntu-1804-3000-9-py3: {extends: '.test_instance'}
  259. # default-centos-8-3000-9-py3: {extends: '.test_instance'}
  260. # default-centos-7-3000-9-py3: {extends: '.test_instance'}
  261. # default-opensuse-leap-153-3000-9-py3: {extends: '.test_instance'}
  262. # default-opensuse-leap-152-3000-9-py3: {extends: '.test_instance'}
  263. # default-amazonlinux-2-3000-9-py3: {extends: '.test_instance'}
  264. # default-oraclelinux-8-3000-9-py3: {extends: '.test_instance'}
  265. # default-oraclelinux-7-3000-9-py3: {extends: '.test_instance'}
  266. # default-gentoo-stage3-latest-3000-9-py3: {extends: '.test_instance'}
  267. # default-gentoo-stage3-systemd-3000-9-py3: {extends: '.test_instance'}
  268. # default-ubuntu-1804-3000-9-py2: {extends: '.test_instance'}
  269. # default-arch-base-latest-3000-9-py2: {extends: '.test_instance'}
  270. ###############################################################################
  271. # `release` stage: `semantic-release`
  272. ###############################################################################
  273. semantic-release:
  274. only: *only_branch_master_parent_repo
  275. stage: *stage_release
  276. image: *image_semanticrelease
  277. variables:
  278. MAINTAINER_TOKEN: '${GH_TOKEN}'
  279. script:
  280. # Update `AUTHORS.md`
  281. - '${HOME}/go/bin/maintainer contributor'
  282. # Run `semantic-release`
  283. - 'semantic-release'