Saltstack Official Apt Formula
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

142 行
5.5KB

  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/apt-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_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14'
  22. # `services`
  23. services_docker_dind: &services_docker_dind
  24. - 'docker:dind'
  25. # `variables`
  26. # https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
  27. # https://bundler.io/v1.16/bundle_config.html
  28. variables_bundler: &variables_bundler
  29. BUNDLE_CACHE_PATH: '${CI_PROJECT_DIR}/.cache/bundler'
  30. BUNDLE_WITHOUT: 'production'
  31. # `cache`
  32. cache_bundler: &cache_bundler
  33. key: '${CI_JOB_STAGE}'
  34. paths:
  35. - '${BUNDLE_CACHE_PATH}'
  36. ###############################################################################
  37. # Define stages and global variables
  38. ###############################################################################
  39. stages:
  40. - *stage_lint
  41. - *stage_test
  42. - *stage_release
  43. variables:
  44. DOCKER_DRIVER: 'overlay2'
  45. ###############################################################################
  46. # `lint` stage: `commitlint` & `pre-commit`
  47. ###############################################################################
  48. commitlint:
  49. stage: *stage_lint
  50. image: *image_commitlint
  51. script:
  52. # Add `upstream` remote to get access to `upstream/master`
  53. - 'git remote add upstream ${CI_PROJECT_URL}.git'
  54. - 'git fetch --all'
  55. # Set default commit hashes for `--from` and `--to`
  56. - 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
  57. - 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
  58. # `coqbot` adds a merge commit to test PRs on top of the latest commit in
  59. # the repo; amend this merge commit message to avoid failure
  60. - |
  61. if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
  62. && [ "${CI_COMMIT_BRANCH}" != "master" ]; then
  63. git commit --amend -m \
  64. 'chore: reword coqbot merge commit message for commitlint'
  65. export COMMITLINT_TO=HEAD
  66. fi
  67. # Run `commitlint`
  68. - 'commitlint --from "${COMMITLINT_FROM}"
  69. --to "${COMMITLINT_TO}"
  70. --verbose'
  71. pre-commit:
  72. stage: *stage_lint
  73. image: *image_precommit
  74. # https://pre-commit.com/#gitlab-ci-example
  75. variables:
  76. PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit'
  77. cache:
  78. key: '${CI_JOB_NAME}'
  79. paths:
  80. - '${PRE_COMMIT_HOME}'
  81. script:
  82. - 'pre-commit run --all-files --color always --verbose'
  83. ###############################################################################
  84. # Define `test` template
  85. ###############################################################################
  86. .test_instance:
  87. stage: *stage_test
  88. image: *image_dindruby
  89. services: *services_docker_dind
  90. variables: *variables_bundler
  91. cache: *cache_bundler
  92. before_script:
  93. # TODO: This should work from the env vars above automatically
  94. - 'bundle config set path "${BUNDLE_CACHE_PATH}"'
  95. - 'bundle config set without "${BUNDLE_WITHOUT}"'
  96. - 'bundle install'
  97. script:
  98. # Alternative value to consider: `${CI_JOB_NAME}`
  99. - 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
  100. ###############################################################################
  101. # `test` stage: each instance below uses the `test` template above
  102. ###############################################################################
  103. ## Define the rest of the matrix based on Kitchen testing
  104. # Make sure the instances listed below match up with
  105. # the `platforms` defined in `kitchen.yml`
  106. repositories-debian-10-master-py3: {extends: '.test_instance'}
  107. # preferences-debian-10-master-py3: {extends: '.test_instance'}
  108. # unattended-debian-10-master-py3: {extends: '.test_instance'}
  109. # debian-10-master-py3: {extends: '.test_instance'}
  110. repositories-ubuntu-1804-master-py3: {extends: '.test_instance'}
  111. # preferences-ubuntu-1804-master-py3: {extends: '.test_instance'}
  112. # unattended-ubuntu-1804-master-py3: {extends: '.test_instance'}
  113. # ubuntu-1804-master-py3: {extends: '.test_instance'}
  114. # repositories-debian-9-2019-2-py3: {extends: '.test_instance'}
  115. preferences-debian-9-2019-2-py3: {extends: '.test_instance'}
  116. # unattended-debian-9-2019-2-py3: {extends: '.test_instance'}
  117. # debian-9-2019-2-py3: {extends: '.test_instance'}
  118. # repositories-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
  119. # preferences-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
  120. unattended-ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
  121. # ubuntu-1804-2019-2-py3: {extends: '.test_instance'}
  122. ###############################################################################
  123. # `release` stage: `semantic-release`
  124. ###############################################################################
  125. semantic-release:
  126. only: *only_branch_master_parent_repo
  127. stage: *stage_release
  128. image: *image_semanticrelease
  129. variables:
  130. MAINTAINER_TOKEN: '${GH_TOKEN}'
  131. script:
  132. # Update `AUTHORS.md`
  133. - '${HOME}/go/bin/maintainer contributor'
  134. # Run `semantic-release`
  135. - 'semantic-release'