2020-12-16 07:18:12 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=yaml
|
|
|
|
---
|
|
|
|
###############################################################################
|
|
|
|
# Define all YAML node anchors
|
|
|
|
###############################################################################
|
|
|
|
.node_anchors:
|
|
|
|
# `only` (also used for `except` where applicable)
|
|
|
|
only_branch_master_parent_repo: &only_branch_master_parent_repo
|
|
|
|
- 'master@saltstack-formulas/apache-formula'
|
|
|
|
# `stage`
|
|
|
|
stage_lint: &stage_lint 'lint'
|
|
|
|
stage_release: &stage_release 'release'
|
|
|
|
stage_test: &stage_test 'test'
|
|
|
|
# `image`
|
|
|
|
image_commitlint: &image_commitlint 'myii/ssf-commitlint:11'
|
|
|
|
image_dindruby: &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3'
|
|
|
|
image_precommit: &image_precommit
|
|
|
|
name: 'myii/ssf-pre-commit:2.9.2'
|
|
|
|
entrypoint: ['/bin/bash', '-c']
|
2020-12-19 15:24:21 +01:00
|
|
|
image_rubocop: &image_rubocop 'pipelinecomponents/rubocop:latest'
|
2021-06-21 21:38:17 +02:00
|
|
|
# yamllint disable-line rule:line-length
|
|
|
|
image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release-pandoc:15.14'
|
2020-12-16 07:18:12 +01:00
|
|
|
# `services`
|
|
|
|
services_docker_dind: &services_docker_dind
|
|
|
|
- 'docker:dind'
|
|
|
|
# `variables`
|
|
|
|
# https://forum.gitlab.com/t/gitlab-com-ci-caching-rubygems/5627/3
|
|
|
|
# https://bundler.io/v1.16/bundle_config.html
|
|
|
|
variables_bundler: &variables_bundler
|
|
|
|
BUNDLE_CACHE_PATH: '${CI_PROJECT_DIR}/.cache/bundler'
|
|
|
|
BUNDLE_WITHOUT: 'production'
|
|
|
|
# `cache`
|
|
|
|
cache_bundler: &cache_bundler
|
|
|
|
key: '${CI_JOB_STAGE}'
|
|
|
|
paths:
|
|
|
|
- '${BUNDLE_CACHE_PATH}'
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Define stages and global variables
|
|
|
|
###############################################################################
|
|
|
|
stages:
|
|
|
|
- *stage_lint
|
|
|
|
- *stage_test
|
|
|
|
- *stage_release
|
|
|
|
variables:
|
|
|
|
DOCKER_DRIVER: 'overlay2'
|
|
|
|
|
2021-05-08 20:37:10 +02:00
|
|
|
###############################################################################
|
|
|
|
# `lint` stage: `commitlint`, `pre-commit` & `rubocop` (latest, failure allowed)
|
|
|
|
###############################################################################
|
|
|
|
commitlint:
|
|
|
|
stage: *stage_lint
|
|
|
|
image: *image_commitlint
|
|
|
|
script:
|
|
|
|
# Add `upstream` remote to get access to `upstream/master`
|
|
|
|
- 'git remote add upstream
|
|
|
|
https://gitlab.com/saltstack-formulas/apache-formula.git'
|
|
|
|
- 'git fetch --all'
|
|
|
|
# Set default commit hashes for `--from` and `--to`
|
|
|
|
- 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"'
|
|
|
|
- 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
|
|
|
|
# `coqbot` adds a merge commit to test PRs on top of the latest commit in
|
|
|
|
# the repo; amend this merge commit message to avoid failure
|
|
|
|
- |
|
|
|
|
if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \
|
|
|
|
&& [ "${CI_COMMIT_BRANCH}" != "master" ]; then
|
|
|
|
git commit --amend -m \
|
|
|
|
'chore: reword coqbot merge commit message for commitlint'
|
|
|
|
export COMMITLINT_TO=HEAD
|
|
|
|
fi
|
|
|
|
# Run `commitlint`
|
|
|
|
- 'commitlint --from "${COMMITLINT_FROM}"
|
|
|
|
--to "${COMMITLINT_TO}"
|
|
|
|
--verbose'
|
|
|
|
|
|
|
|
pre-commit:
|
|
|
|
stage: *stage_lint
|
|
|
|
image: *image_precommit
|
|
|
|
# https://pre-commit.com/#gitlab-ci-example
|
|
|
|
variables:
|
|
|
|
PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit'
|
|
|
|
cache:
|
|
|
|
key: '${CI_JOB_NAME}'
|
|
|
|
paths:
|
|
|
|
- '${PRE_COMMIT_HOME}'
|
|
|
|
script:
|
|
|
|
- 'pre-commit run --all-files --color always --verbose'
|
|
|
|
|
|
|
|
# Use a separate job for `rubocop` other than the one potentially run by `pre-commit`
|
|
|
|
# - The `pre-commit` check will only be available for formulas that pass the default
|
|
|
|
# `rubocop` check -- and must continue to do so
|
|
|
|
# - This job is allowed to fail, so can be used for all formulas
|
|
|
|
# - Furthermore, this job uses all of the latest `rubocop` features & cops,
|
|
|
|
# which will help when upgrading the `rubocop` linter used in `pre-commit`
|
|
|
|
rubocop:
|
|
|
|
allow_failure: true
|
|
|
|
stage: *stage_lint
|
|
|
|
image: *image_rubocop
|
|
|
|
script:
|
|
|
|
- 'rubocop -d -P -S --enable-pending-cops'
|
2020-12-19 15:24:21 +01:00
|
|
|
|
2020-12-16 07:18:12 +01:00
|
|
|
###############################################################################
|
|
|
|
# Define `test` template
|
|
|
|
###############################################################################
|
|
|
|
.test_instance:
|
|
|
|
stage: *stage_test
|
|
|
|
image: *image_dindruby
|
|
|
|
services: *services_docker_dind
|
|
|
|
variables: *variables_bundler
|
|
|
|
cache: *cache_bundler
|
|
|
|
before_script:
|
|
|
|
# TODO: This should work from the env vars above automatically
|
|
|
|
- 'bundle config set path "${BUNDLE_CACHE_PATH}"'
|
|
|
|
- 'bundle config set without "${BUNDLE_WITHOUT}"'
|
|
|
|
- 'bundle install'
|
|
|
|
script:
|
|
|
|
# Alternative value to consider: `${CI_JOB_NAME}`
|
|
|
|
- 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# `test` stage: each instance below uses the `test` template above
|
|
|
|
###############################################################################
|
|
|
|
## Define the rest of the matrix based on Kitchen testing
|
|
|
|
# Make sure the instances listed below match up with
|
|
|
|
# the `platforms` defined in `kitchen.yml`
|
2021-07-18 19:55:20 +02:00
|
|
|
# default-debian-11-tiamat-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# default-debian-10-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-debian-9-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-8-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-7-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-amazonlinux-2-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-8-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-almalinux-8-tiamat-py3: {extends: '.test_instance'}
|
|
|
|
# default-rockylinux-8-tiamat-py3: {extends: '.test_instance'}
|
2021-07-18 19:55:20 +02:00
|
|
|
# default-debian-11-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-debian-11-master-py3: {extends: '.test_instance'}
|
|
|
|
debian-11-master-py3: {extends: '.test_instance'}
|
2021-02-02 00:54:56 +01:00
|
|
|
# default-debian-10-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# modules-debian-10-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
debian-10-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# default-debian-9-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-debian-9-master-py3: {extends: '.test_instance'}
|
|
|
|
# debian-9-master-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-2004-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-ubuntu-2004-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
ubuntu-2004-master-py3: {extends: '.test_instance'}
|
2021-02-02 00:54:56 +01:00
|
|
|
# default-ubuntu-1804-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-ubuntu-1804-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
ubuntu-1804-master-py3: {extends: '.test_instance'}
|
2021-02-02 00:54:56 +01:00
|
|
|
# default-centos-8-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# modules-centos-8-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
centos-8-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# default-centos-7-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-centos-7-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
centos-7-master-py3: {extends: '.test_instance'}
|
2021-04-23 09:41:59 +02:00
|
|
|
# default-fedora-34-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-fedora-34-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
fedora-34-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# default-fedora-33-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-fedora-33-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
fedora-33-master-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-opensuse-leap-153-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-opensuse-leap-153-master-py3: {extends: '.test_instance'}
|
|
|
|
opensuse-leap-153-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# default-opensuse-leap-152-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-opensuse-leap-152-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
opensuse-leap-152-master-py3: {extends: '.test_instance'}
|
|
|
|
default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# modules-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
|
|
|
|
# opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
|
2021-02-02 00:54:56 +01:00
|
|
|
# https://community.letsencrypt.org/t/localhost-crt-does-not-exist-or-is-empty/103979
|
2021-05-08 20:37:10 +02:00
|
|
|
default-amazonlinux-2-master-py3: {extends: '.test_instance'}
|
2021-02-02 00:54:56 +01:00
|
|
|
# modules-amazonlinux-2-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# amazonlinux-2-master-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-oraclelinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
# oraclelinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-7-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-oraclelinux-7-master-py3: {extends: '.test_instance'}
|
2021-05-08 20:37:10 +02:00
|
|
|
oraclelinux-7-master-py3: {extends: '.test_instance'}
|
2021-05-09 23:23:59 +02:00
|
|
|
# default-arch-base-latest-master-py3: {extends: '.test_instance'}
|
|
|
|
modules-arch-base-latest-master-py3: {extends: '.test_instance'}
|
|
|
|
# arch-base-latest-master-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# default-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
|
|
|
|
# gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
|
|
|
|
# gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-almalinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-almalinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
almalinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
# default-rockylinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
# modules-rockylinux-8-master-py3: {extends: '.test_instance'}
|
|
|
|
rockylinux-8-master-py3: {extends: '.test_instance'}
|
2021-08-19 11:07:56 +02:00
|
|
|
# default-debian-11-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-debian-10-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-debian-9-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-2004-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-1804-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-8-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-7-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-fedora-34-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-fedora-33-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-opensuse-leap-153-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-opensuse-leap-152-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-opensuse-tmbl-latest-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-amazonlinux-2-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-8-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-7-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-arch-base-latest-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-latest-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-systemd-3003-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-almalinux-8-3003-2-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-arch-base-latest-3003-1-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-latest-3003-1-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-systemd-3003-1-py3: {extends: '.test_instance'}
|
2021-07-18 19:55:20 +02:00
|
|
|
# default-debian-11-3002-6-py3: {extends: '.test_instance'}
|
2021-04-23 09:41:59 +02:00
|
|
|
# default-debian-10-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-debian-9-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-2004-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-1804-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-8-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-7-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-fedora-34-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-fedora-33-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-amazonlinux-2-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-8-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-7-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-arch-base-latest-3002-6-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-gentoo-stage3-latest-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-systemd-3002-6-py3: {extends: '.test_instance'}
|
|
|
|
# default-opensuse-leap-153-3002-2-py3: {extends: '.test_instance'}
|
2021-02-13 17:33:37 +01:00
|
|
|
# default-opensuse-leap-152-3002-2-py3: {extends: '.test_instance'}
|
|
|
|
# default-opensuse-tmbl-latest-3002-2-py3: {extends: '.test_instance'}
|
2021-04-23 09:41:59 +02:00
|
|
|
# default-debian-10-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-debian-9-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-2004-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-1804-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-8-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-7-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-fedora-34-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-fedora-33-3001-7-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-opensuse-leap-153-3001-7-py3: {extends: '.test_instance'}
|
2021-04-23 09:41:59 +02:00
|
|
|
# default-opensuse-leap-152-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-opensuse-tmbl-latest-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-amazonlinux-2-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-8-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-7-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-arch-base-latest-3001-7-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-gentoo-stage3-latest-3001-7-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-systemd-3001-7-py3: {extends: '.test_instance'}
|
2021-04-23 09:41:59 +02:00
|
|
|
# default-debian-10-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-debian-9-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-ubuntu-1804-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-8-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-centos-7-3000-9-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-opensuse-leap-153-3000-9-py3: {extends: '.test_instance'}
|
2021-04-23 09:41:59 +02:00
|
|
|
# default-opensuse-leap-152-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-amazonlinux-2-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-8-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-oraclelinux-7-3000-9-py3: {extends: '.test_instance'}
|
2021-07-02 00:58:05 +02:00
|
|
|
# default-gentoo-stage3-latest-3000-9-py3: {extends: '.test_instance'}
|
|
|
|
# default-gentoo-stage3-systemd-3000-9-py3: {extends: '.test_instance'}
|
2021-04-23 09:41:59 +02:00
|
|
|
# default-ubuntu-1804-3000-9-py2: {extends: '.test_instance'}
|
|
|
|
# default-arch-base-latest-3000-9-py2: {extends: '.test_instance'}
|
2020-12-16 07:18:12 +01:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# `release` stage: `semantic-release`
|
|
|
|
###############################################################################
|
|
|
|
semantic-release:
|
2021-05-08 20:37:10 +02:00
|
|
|
only: *only_branch_master_parent_repo
|
2020-12-16 07:18:12 +01:00
|
|
|
stage: *stage_release
|
|
|
|
image: *image_semanticrelease
|
|
|
|
variables:
|
|
|
|
MAINTAINER_TOKEN: '${GH_TOKEN}'
|
|
|
|
script:
|
|
|
|
# Update `AUTHORS.md`
|
|
|
|
- '${HOME}/go/bin/maintainer contributor'
|
|
|
|
# Run `semantic-release`
|
|
|
|
- 'semantic-release'
|