Saltstack Official Apache Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

272 行
13KB

  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. image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release-pandoc: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/apache-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:
  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. # `test` stage: each instance below uses the `test` template above
  116. ###############################################################################
  117. ## Define the rest of the matrix based on Kitchen testing
  118. # Make sure the instances listed below match up with
  119. # the `platforms` defined in `kitchen.yml`
  120. # default-debian-10-tiamat-py3: {extends: '.test_instance'}
  121. # default-debian-9-tiamat-py3: {extends: '.test_instance'}
  122. # default-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
  123. # default-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
  124. # default-ubuntu-1604-tiamat-py3: {extends: '.test_instance'}
  125. # default-centos-8-tiamat-py3: {extends: '.test_instance'}
  126. # default-centos-7-tiamat-py3: {extends: '.test_instance'}
  127. # default-amazonlinux-2-tiamat-py3: {extends: '.test_instance'}
  128. # default-oraclelinux-8-tiamat-py3: {extends: '.test_instance'}
  129. # default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'}
  130. # default-debian-10-master-py3: {extends: '.test_instance'}
  131. # modules-debian-10-master-py3: {extends: '.test_instance'}
  132. debian-10-master-py3: {extends: '.test_instance'}
  133. # default-debian-9-master-py3: {extends: '.test_instance'}
  134. # modules-debian-9-master-py3: {extends: '.test_instance'}
  135. # debian-9-master-py3: {extends: '.test_instance'}
  136. # default-ubuntu-2004-master-py3: {extends: '.test_instance'}
  137. # modules-ubuntu-2004-master-py3: {extends: '.test_instance'}
  138. ubuntu-2004-master-py3: {extends: '.test_instance'}
  139. # default-ubuntu-1804-master-py3: {extends: '.test_instance'}
  140. # modules-ubuntu-1804-master-py3: {extends: '.test_instance'}
  141. ubuntu-1804-master-py3: {extends: '.test_instance'}
  142. # default-ubuntu-1604-master-py3: {extends: '.test_instance'}
  143. # modules-ubuntu-1604-master-py3: {extends: '.test_instance'}
  144. ubuntu-1604-master-py3: {extends: '.test_instance'}
  145. # default-centos-8-master-py3: {extends: '.test_instance'}
  146. # modules-centos-8-master-py3: {extends: '.test_instance'}
  147. centos-8-master-py3: {extends: '.test_instance'}
  148. # default-centos-7-master-py3: {extends: '.test_instance'}
  149. # modules-centos-7-master-py3: {extends: '.test_instance'}
  150. centos-7-master-py3: {extends: '.test_instance'}
  151. # default-fedora-34-master-py3: {extends: '.test_instance'}
  152. # modules-fedora-34-master-py3: {extends: '.test_instance'}
  153. fedora-34-master-py3: {extends: '.test_instance'}
  154. # default-fedora-33-master-py3: {extends: '.test_instance'}
  155. # modules-fedora-33-master-py3: {extends: '.test_instance'}
  156. fedora-33-master-py3: {extends: '.test_instance'}
  157. # default-fedora-32-master-py3: {extends: '.test_instance'}
  158. # modules-fedora-32-master-py3: {extends: '.test_instance'}
  159. fedora-32-master-py3: {extends: '.test_instance'}
  160. # default-opensuse-leap-152-master-py3: {extends: '.test_instance'}
  161. # modules-opensuse-leap-152-master-py3: {extends: '.test_instance'}
  162. opensuse-leap-152-master-py3: {extends: '.test_instance'}
  163. default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
  164. # modules-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
  165. # opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
  166. # https://community.letsencrypt.org/t/localhost-crt-does-not-exist-or-is-empty/103979
  167. default-amazonlinux-2-master-py3: {extends: '.test_instance'}
  168. # modules-amazonlinux-2-master-py3: {extends: '.test_instance'}
  169. # amazonlinux-2-master-py3: {extends: '.test_instance'}
  170. # default-oraclelinux-8-master-py3: {extends: '.test_instance'}
  171. # modules-oraclelinux-8-master-py3: {extends: '.test_instance'}
  172. # oraclelinux-8-master-py3: {extends: '.test_instance'}
  173. # default-oraclelinux-7-master-py3: {extends: '.test_instance'}
  174. # modules-oraclelinux-7-master-py3: {extends: '.test_instance'}
  175. oraclelinux-7-master-py3: {extends: '.test_instance'}
  176. # default-arch-base-latest-master-py3: {extends: '.test_instance'}
  177. modules-arch-base-latest-master-py3: {extends: '.test_instance'}
  178. # arch-base-latest-master-py3: {extends: '.test_instance'}
  179. # default-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
  180. # modules-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
  181. # gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
  182. # default-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
  183. # modules-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
  184. # gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
  185. # default-debian-10-3003-0-py3: {extends: '.test_instance'}
  186. # default-debian-9-3003-0-py3: {extends: '.test_instance'}
  187. # default-ubuntu-2004-3003-0-py3: {extends: '.test_instance'}
  188. # default-ubuntu-1804-3003-0-py3: {extends: '.test_instance'}
  189. # default-centos-8-3003-0-py3: {extends: '.test_instance'}
  190. # default-centos-7-3003-0-py3: {extends: '.test_instance'}
  191. # default-fedora-34-3003-0-py3: {extends: '.test_instance'}
  192. # default-fedora-33-3003-0-py3: {extends: '.test_instance'}
  193. # default-fedora-32-3003-0-py3: {extends: '.test_instance'}
  194. # default-amazonlinux-2-3003-0-py3: {extends: '.test_instance'}
  195. # default-oraclelinux-8-3003-0-py3: {extends: '.test_instance'}
  196. # default-oraclelinux-7-3003-0-py3: {extends: '.test_instance'}
  197. # default-arch-base-latest-3003-0-py3: {extends: '.test_instance'}
  198. # default-gentoo-stage3-latest-3003-0-py3: {extends: '.test_instance'}
  199. # default-gentoo-stage3-systemd-3003-0-py3: {extends: '.test_instance'}
  200. # default-debian-10-3002-6-py3: {extends: '.test_instance'}
  201. # default-debian-9-3002-6-py3: {extends: '.test_instance'}
  202. # default-ubuntu-2004-3002-6-py3: {extends: '.test_instance'}
  203. # default-ubuntu-1804-3002-6-py3: {extends: '.test_instance'}
  204. # default-ubuntu-1604-3002-6-py3: {extends: '.test_instance'}
  205. # default-centos-8-3002-6-py3: {extends: '.test_instance'}
  206. # default-centos-7-3002-6-py3: {extends: '.test_instance'}
  207. # default-fedora-34-3002-6-py3: {extends: '.test_instance'}
  208. # default-fedora-33-3002-6-py3: {extends: '.test_instance'}
  209. # default-fedora-32-3002-6-py3: {extends: '.test_instance'}
  210. # default-amazonlinux-2-3002-6-py3: {extends: '.test_instance'}
  211. # default-oraclelinux-8-3002-6-py3: {extends: '.test_instance'}
  212. # default-oraclelinux-7-3002-6-py3: {extends: '.test_instance'}
  213. # default-arch-base-latest-3002-6-py3: {extends: '.test_instance'}
  214. # default-gentoo-stage3-latest-3002-5-py3: {extends: '.test_instance'}
  215. # default-gentoo-stage3-systemd-3002-5-py3: {extends: '.test_instance'}
  216. # default-opensuse-leap-152-3002-2-py3: {extends: '.test_instance'}
  217. # default-opensuse-tmbl-latest-3002-2-py3: {extends: '.test_instance'}
  218. # default-debian-10-3001-7-py3: {extends: '.test_instance'}
  219. # default-debian-9-3001-7-py3: {extends: '.test_instance'}
  220. # default-ubuntu-2004-3001-7-py3: {extends: '.test_instance'}
  221. # default-ubuntu-1804-3001-7-py3: {extends: '.test_instance'}
  222. # default-ubuntu-1604-3001-7-py3: {extends: '.test_instance'}
  223. # default-centos-8-3001-7-py3: {extends: '.test_instance'}
  224. # default-centos-7-3001-7-py3: {extends: '.test_instance'}
  225. # default-fedora-34-3001-7-py3: {extends: '.test_instance'}
  226. # default-fedora-33-3001-7-py3: {extends: '.test_instance'}
  227. # default-fedora-32-3001-7-py3: {extends: '.test_instance'}
  228. # default-opensuse-leap-152-3001-7-py3: {extends: '.test_instance'}
  229. # default-opensuse-tmbl-latest-3001-7-py3: {extends: '.test_instance'}
  230. # default-amazonlinux-2-3001-7-py3: {extends: '.test_instance'}
  231. # default-oraclelinux-8-3001-7-py3: {extends: '.test_instance'}
  232. # default-oraclelinux-7-3001-7-py3: {extends: '.test_instance'}
  233. # default-arch-base-latest-3001-7-py3: {extends: '.test_instance'}
  234. # default-gentoo-stage3-latest-3001-6-py3: {extends: '.test_instance'}
  235. # default-gentoo-stage3-systemd-3001-6-py3: {extends: '.test_instance'}
  236. # default-debian-10-3000-9-py3: {extends: '.test_instance'}
  237. # default-debian-9-3000-9-py3: {extends: '.test_instance'}
  238. # default-ubuntu-1804-3000-9-py3: {extends: '.test_instance'}
  239. # default-ubuntu-1604-3000-9-py3: {extends: '.test_instance'}
  240. # default-centos-8-3000-9-py3: {extends: '.test_instance'}
  241. # default-centos-7-3000-9-py3: {extends: '.test_instance'}
  242. # default-opensuse-leap-152-3000-9-py3: {extends: '.test_instance'}
  243. # default-amazonlinux-2-3000-9-py3: {extends: '.test_instance'}
  244. # default-oraclelinux-8-3000-9-py3: {extends: '.test_instance'}
  245. # default-oraclelinux-7-3000-9-py3: {extends: '.test_instance'}
  246. # default-ubuntu-1804-3000-9-py2: {extends: '.test_instance'}
  247. # default-ubuntu-1604-3000-9-py2: {extends: '.test_instance'}
  248. # default-arch-base-latest-3000-9-py2: {extends: '.test_instance'}
  249. # default-gentoo-stage3-latest-3000-8-py3: {extends: '.test_instance'}
  250. # default-gentoo-stage3-systemd-3000-8-py3: {extends: '.test_instance'}
  251. ###############################################################################
  252. # `release` stage: `semantic-release`
  253. ###############################################################################
  254. semantic-release:
  255. only: *only_branch_master_parent_repo
  256. stage: *stage_release
  257. image: *image_semanticrelease
  258. variables:
  259. MAINTAINER_TOKEN: '${GH_TOKEN}'
  260. script:
  261. # Update `AUTHORS.md`
  262. - '${HOME}/go/bin/maintainer contributor'
  263. # Run `semantic-release`
  264. - 'semantic-release'