diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..d71e8c25 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,83 @@ +# -*- 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@myii/ssf-formula' + # `stage` + stage_lint: &stage_lint 'lint' + stage_release: &stage_release 'release' + # `image` + image_commitlint: &image_commitlint 'myii/ssf-commitlint:11' + image_precommit: &image_precommit + name: 'myii/ssf-pre-commit:2.9.2' + entrypoint: ['/bin/bash', '-c'] + image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14' + +############################################################################### +# Define stages and global variables +############################################################################### +stages: + - *stage_lint + - *stage_release +variables: + DOCKER_DRIVER: 'overlay2' + +############################################################################### +# `lint` stage: `commitlint` & `pre-commit` +############################################################################### +commitlint: + stage: *stage_lint + image: *image_commitlint + script: + # Add `upstream` remote to get access to `upstream/master` + - 'git remote add upstream ${CI_PROJECT_URL}.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' + +############################################################################### +# `release` stage: `semantic-release` +############################################################################### +semantic-release: + only: *only_branch_master_parent_repo + 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' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 78cadd98..00000000 --- a/.travis.yml +++ /dev/null @@ -1,100 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=yaml ---- -## Machine config -os: 'linux' -arch: 'amd64' -dist: 'bionic' -version: '~> 1.0' - -## Language and cache config -language: 'ruby' -cache: 'bundler' - -## Stages and jobs matrix -stages: - - test - - name: 'release' - if: 'branch = master AND type != pull_request' -jobs: - include: - ## Define the test stage that runs the linters (and testing matrix, if applicable) - - # Run all of the linters in a single job - - language: 'node_js' - node_js: 'lts/*' - env: 'Lint' - name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint' - before_install: 'skip' - script: - # Install and run `salt-lint` - - pip install --user salt-lint - - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst' - | xargs salt-lint - # Install and run `yamllint` - # Need at least `v1.17.0` for the `yaml-files` setting - - pip install --user yamllint>=1.17.0 - - yamllint -s . - # Install and run `rubocop` - - gem install rubocop - - rubocop -d - # Run `shellcheck` (already pre-installed in Travis) - - shellcheck --version - - git ls-files -- '*.sh' '*.bash' '*.ksh' - | xargs shellcheck - # Install and run `commitlint` - - npm i -D @commitlint/config-conventional - @commitlint/travis-cli - - commitlint-travis --verbose - - # Run `pre-commit` linters in a single job - - language: 'python' - env: 'Lint_pre-commit' - name: 'Lint: pre-commit' - before_install: 'skip' - cache: - directories: - - $HOME/.cache/pre-commit - script: - # Install and run `pre-commit` - - pip install pre-commit==2.7.1 - - pre-commit run --all-files --color always --verbose - - pre-commit run --color always --hook-stage manual --verbose commitlint-travis - - ## Define the release stage that runs `semantic-release` - - stage: 'release' - language: 'node_js' - node_js: 'lts/*' - env: 'Release' - name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' - before_install: 'skip' - script: - # Update `AUTHORS.md` - - export MAINTAINER_TOKEN=${GH_TOKEN} - - go get github.com/myii/maintainer - - maintainer contributor - - # Install all dependencies required for `semantic-release` - - npm i -D @semantic-release/changelog@3 - @semantic-release/exec@3 - @semantic-release/git@7 - deploy: - provider: 'script' - # Opt-in to `dpl v2` to complete the Travis build config validation (beta) - # * https://docs.travis-ci.com/user/build-config-validation - # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default - edge: true - # Run `semantic-release` - script: 'npx semantic-release@15.14' - -# Notification options: `always`, `never` or `change` -notifications: - webhooks: - if: 'repo = myii/ssf-formula' - urls: - - https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=myii%2Fssf-formula&ignore_pull_requests=false - on_success: always # default: always - on_failure: always # default: always - on_start: always # default: never - on_cancel: always # default: always - on_error: always # default: always diff --git a/.yamllint b/.yamllint index 3824c504..f8e785dd 100644 --- a/.yamllint +++ b/.yamllint @@ -11,10 +11,12 @@ extends: 'default' # 4. All Jinja templates under `ssf/files/` (result in `yamllint` syntax errors) # Not disabling via. `*.yml` since we may end up with non-Jinja YAML files here ignore: | + .cache/ node_modules/ test/**/states/**/*.sls .kitchen/ ssf/files/default/.cirrus.yml + ssf/files/default/.gitlab-ci.yml ssf/files/default/.pre-commit-config.yaml ssf/files/default/.rubocop.yml ssf/files/default/.salt-lint diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst index b7da8f49..23f3f22a 100644 --- a/docs/CONTRIBUTING.rst +++ b/docs/CONTRIBUTING.rst @@ -32,7 +32,7 @@ The entire process relies on the structure of commit messages to determine the v Full details are available in the upstream docs regarding the `Angular Commit Message Conventions `_. The key factor is that the first line of the commit message must follow this format: -.. code-block:: +.. code-block:: console type(scope): subject @@ -55,6 +55,22 @@ So based on the example above: * The ``(scope):`` will be shown in bold text without the brackets. * The ``subject`` follows the ``scope`` as standard text. +pre-commit +^^^^^^^^^^ + +`pre-commit `_ is configured for this formula, which you may +optionally use to ease the steps involved in submitting your changes, including +checking the formatting of your commit messages. + +First install the ``pre-commit`` package manager locally using the appropriate +`method `_, then run ``bin/install-hooks`` in the +formula's root directory and now ``pre-commit`` will run automatically on each +``git commit``. :: + + $ bin/install-hooks + pre-commit installed at .git/hooks/pre-commit + pre-commit installed at .git/hooks/commit-msg + Linting commit messages in Travis CI ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -156,4 +172,3 @@ An example of that: BREAKING CHANGE: With the removal of all of the `.sls` files under `template package`, this formula no longer supports the installation of packages. - diff --git a/docs/TOFS_pattern.rst b/docs/TOFS_pattern.rst index 4fea5dda..dd2c17e5 100644 --- a/docs/TOFS_pattern.rst +++ b/docs/TOFS_pattern.rst @@ -64,7 +64,7 @@ Example: NTP before applying TOFS Let's work with the NTP example. A basic formula that follows the `design guidelines `_ has the following files and directories tree: -.. code-block:: +.. code-block:: console /srv/saltstack/salt-formulas/ntp-saltstack-formula/ ntp/ @@ -226,7 +226,7 @@ We can make different templates coexist for different minions, classified by any If we decide that we want ``os_family`` as switch, then we could provide the formula template variants for both the ``RedHat`` and ``Debian`` families. -.. code-block:: +.. code-block:: console /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/files/ default/ @@ -449,7 +449,7 @@ Using sub-directories for ``components`` If your formula is composed of several components, you may prefer to provides files under sub-directories, like in the `systemd-formula `_. -.. code-block:: +.. code-block:: console /srv/saltstack/systemd-formula/ systemd/ diff --git a/pillar.example b/pillar.example index 2f2ef71b..59f9f2c1 100644 --- a/pillar.example +++ b/pillar.example @@ -184,6 +184,7 @@ ssf: - inspec/README.md - .gitignore - .cirrus.yml + - .gitlab-ci.yml - .pre-commit-config.yaml - .rstcheck.cfg - .rubocop.yml diff --git a/pre-commit_semantic-release.sh b/pre-commit_semantic-release.sh index ba805352..458b7b64 100755 --- a/pre-commit_semantic-release.sh +++ b/pre-commit_semantic-release.sh @@ -11,7 +11,7 @@ sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA ############################################################################### # Install `m2r` -sudo -H pip install m2r +pip3 install m2r # Copy and then convert the `.md` docs cp ./*.md docs/ diff --git a/release.config.js b/release.config.js index 6af7aa8f..14b47385 100644 --- a/release.config.js +++ b/release.config.js @@ -1,5 +1,6 @@ module.exports = { branch: 'master', + repositoryUrl: 'https://github.com/myii/ssf-formula', plugins: [ ['@semantic-release/commit-analyzer', { preset: 'angular', diff --git a/ssf/config/formulas.sls b/ssf/config/formulas.sls index 345afc2b..ff2c4fe8 100644 --- a/ssf/config/formulas.sls +++ b/ssf/config/formulas.sls @@ -101,10 +101,12 @@ prepare-git-branch-for-{{ formula }}: {#- Or if the file is `libsaltcli.jinja` and `use_libsaltcli` is `False` #} {#- Likewise, if running the state for TOFS files when `use_tofs` is `False` #} {#- Also remove the local `CONTRIBUTING` file to use the org-level file instead #} +{#- Furthermore, remove `.travis.yml` for the `ssf-formula` #} {%- if (semrel_file == '.cirrus.yml' and not use_cirrus_ci) or (semrel_file == 'formula/libsaltcli.jinja' and not use_libsaltcli) or (semrel_file in ['docs/TOFS_pattern.rst', 'formula/libtofs.jinja'] and not use_tofs) or - (semrel_file in ['docs/CONTRIBUTING.rst'] and formula not in ['.github', 'ssf-formula']) + (semrel_file in ['docs/CONTRIBUTING.rst'] and formula not in ['.github', 'ssf-formula']) or + (semrel_file in ['.travis.yml'] and formula in ['ssf-formula']) %} {%- set add_or_rm = ['rm', 'remove', 'absent'] %} {%- endif %} @@ -134,6 +136,7 @@ prepare-git-branch-for-{{ formula }}: owner: {{ owner }} formula: {{ formula }} codeowners: {{ context.codeowners | yaml }} + gitlab: {{ context.git.gitlab | yaml }} inspec_suites_kitchen: {{ inspec_suites_kitchen | yaml }} inspec_suites_matrix: {{ context.inspec_suites_matrix | yaml }} kitchen: {{ context.kitchen | yaml }} diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index cdca032e..ad148c43 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -22,12 +22,13 @@ ssf_node_anchors: - '/docs/AUTHORS.rst': '@saltstack-formulas/ssf' - '/docs/CHANGELOG.rst': '@saltstack-formulas/ssf' - '/docs/TOFS_pattern.rst': '@saltstack-formulas/ssf' - - '/./libsaltcli.jinja': '@saltstack-formulas/ssf' - - '/./libtofs.jinja': '@saltstack-formulas/ssf' + - '/*/libsaltcli.jinja': '@saltstack-formulas/ssf' + - '/*/libtofs.jinja': '@saltstack-formulas/ssf' - '/test/integration/**/inspec.yml': '@saltstack-formulas/ssf' - '/test/integration/**/README.md': '@saltstack-formulas/ssf' - '/.gitignore': '@saltstack-formulas/ssf' - '/.cirrus.yml': '@saltstack-formulas/ssf' + - '/.gitlab-ci.yml': '@saltstack-formulas/ssf' - '/.pre-commit-config.yaml': '@saltstack-formulas/ssf' - '/.rstcheck.cfg': '@saltstack-formulas/ssf' - '/.rubocop.yml': '@saltstack-formulas/ssf' @@ -58,8 +59,8 @@ ssf_node_anchors: # An alternative method could be to use: # `git describe --abbrev=0 --tags` # yamllint disable rule:line-length rule:quoted-strings - title: "test(map): verify '`'map.jinja'`' dump using '`'_mapdata'`' state" - body: '* Semi-automated using https://github.com/myii/ssf-formula/pull/271' + title: "ci(gitlab-ci): use GitLab CI as Travis CI replacement" + body: '* Automated using https://github.com/myii/ssf-formula/pull/275' # yamllint enable rule:line-length rule:quoted-strings github: owner: 'saltstack-formulas' @@ -71,6 +72,12 @@ ssf_node_anchors: fork: name: 'origin' branch: 'master' + # Currently supporting `ci_cd_only` for GitHub repos + gitlab: + # `coqbot` doesn't currently support sub-groups, only `owner/repo` + # owner: 'saltstack-formulas/formulas/github/saltstack-formulas' + owner: 'saltstack-formulas' + repo: '' inspec_suites_kitchen: &isk_default 0: &isk_suite_default name: 'default' @@ -184,7 +191,7 @@ ssf_node_anchors: - [amazonlinux , 2 , 2019.2, 3, default] - [fedora , 30 , 2018.3, 3, default] - [arch-base , latest, 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [centos , 6 , 2017.7, 2, default] # To deal with excessive instances when mimicking `kitchen list -b` # If values are set, only use these as commented entries in the matrix platforms_matrix_commented_includes: [] @@ -220,6 +227,7 @@ ssf_node_anchors: extends: 'default' ignore: default: + - '.cache/' - 'node_modules/' additional_ssf: - 'test/**/states/**/*.sls' @@ -499,7 +507,21 @@ ssf: name: 'ubuntu' dhcpd: *formula_default django: *formula_default - docker: *formula_default + docker: + <<: *formula_default + context: + <<: *context_default + inspec_suites_kitchen: + <<: *isk_default + 0: + <<: *isk_suite_default + name: 'archive' + 1: + <<: *isk_suite_default + name: 'package' + 2: + <<: *isk_suite_default + name: 'clean' eclipse: <<: *formula_default context: @@ -922,12 +944,6 @@ ssf: 2: <<: *isk_suite_default name: 'v3000-py2' - 3: - <<: *isk_suite_default - name: 'v201902-py3' - 4: - <<: *isk_suite_default - name: 'v201902-py2' sqldeveloper: *formula_default sqlplus: *formula_default ssf: *formula_default diff --git a/ssf/files/default/.gitlab-ci.yml b/ssf/files/default/.gitlab-ci.yml new file mode 100644 index 00000000..07349f2e --- /dev/null +++ b/ssf/files/default/.gitlab-ci.yml @@ -0,0 +1,198 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +{%- from tplroot ~ "/libcimatrix.jinja" import format_ci_matrix with context %} + +{#- Prepare variable used for `saltcheck` #} +{%- set use_saltcheck = False %} +{%- if semrel_formula in ['cron'] %} +{%- set use_saltcheck = True %} +{%- endif %} +############################################################################### +# 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@{{ gitlab.owner }}/{{ gitlab.repo or formula }}' + # `stage` + stage_lint: &stage_lint 'lint' + stage_release: &stage_release 'release' + {%- if semrel_formula != 'ssf' %} + stage_test: &stage_test 'test' + {%- endif %} + # `image` + image_commitlint: &image_commitlint 'myii/ssf-commitlint:11' + {%- if semrel_formula != 'ssf' %} + image_dindruby: &image_dindruby 'myii/ssf-dind-ruby:2.7.1-r3' + {%- if semrel_formula == 'template' %} + image_dindrubybionic: &image_dindrubybionic 'myii/ssf-dind-ruby-bionic:1_2.5.1' + {%- endif %} + {%- endif %} + image_precommit: &image_precommit + name: 'myii/ssf-pre-commit:2.9.2' + entrypoint: ['/bin/bash', '-c'] + image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14' + {%- if semrel_formula != 'ssf' %} + # `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}' + {%- endif %} + +############################################################################### +# Define stages and global variables +############################################################################### +stages: + - *stage_lint + {%- if semrel_formula != 'ssf' %} + - *stage_test + {%- endif %} + - *stage_release +variables: + DOCKER_DRIVER: 'overlay2' + +############################################################################### +# `lint` stage: `commitlint` & `pre-commit` +############################################################################### +commitlint: + stage: *stage_lint + image: *image_commitlint + script: + # Add `upstream` remote to get access to `upstream/master` + - 'git remote add upstream ${CI_PROJECT_URL}.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' + +{%- if platforms and not use_cirrus_ci %} + +############################################################################### +# Define `test` template +############################################################################### +.test_instance: + stage: *stage_test + image: *image_dindruby + services: *services_docker_dind + variables: *variables_bundler + cache: *cache_bundler + before_script: + {%- if semrel_formula == 'keepalived' %} + - 'apk --no-cache add ipvsadm' + {%- endif %} + # 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}` + - '{{ script_kitchen.bin }} {{ script_kitchen.cmd }} "${DOCKER_ENV_CI_JOB_NAME}"' + +{%- if semrel_formula == 'template' %} +# +{%- endif %} + +############################################################################### +# `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` +{%- if semrel_formula == 'template' %} +# +{%- endif %} +{{- format_ci_matrix(platforms, inspec_suites_kitchen, inspec_suites_matrix, platforms_matrix, platforms_matrix_commented_includes, semrel_formula, width=0, use_gitlab_format=True) }} +{%- endif %} + +############################################################################### +# `release` stage: `semantic-release` +############################################################################### +semantic-release: + only: *only_branch_master_parent_repo + 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' diff --git a/ssf/files/default/.travis.yml b/ssf/files/default/.travis.yml index 5ce4db20..6e194986 100644 --- a/ssf/files/default/.travis.yml +++ b/ssf/files/default/.travis.yml @@ -1,6 +1,15 @@ # -*- coding: utf-8 -*- # vim: ft=yaml --- +################################################################################ +# NOTE: This file is UNMAINTAINED; it is provided for references purposes only. +# No guarantees are tendered that this structure will work after 2020. +################################################################################ +# * https://en.wikipedia.org/wiki/Travis_CI: +# - "... free open-source plans were removed in [sic] the end of 2020" +# - https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing +# - https://ropensci.org/technotes/2020/11/19/moving-away-travis/ +################################################################################ {%- from tplroot ~ "/libcimatrix.jinja" import format_ci_matrix with context %} {%- macro format_allow_failures(use_single_job_for_linters) %} @@ -104,8 +113,10 @@ script: ## Stages and jobs matrix stages: - test - - name: 'release' - if: 'branch = master AND type != pull_request' + # # As part of the switch away from Travis CI, ensure that the `release` stage + # # is not run inadvertently + # - name: 'release' + # if: 'branch = master AND type != pull_request' jobs: {{- format_allow_failures(travis.use_single_job_for_linters) }} include: @@ -200,9 +211,13 @@ jobs: - env: 'Conversion' name: 'Test: bin/convert-formula.sh' script: - - git clone . tmp/converted-formula - - cd tmp/converted-formula - - DEBUG=true bin/convert-formula.sh converted + - export CONVERTED=test-the-use_this_template-button + - git clone . tmp/"$CONVERTED"-formula + - cd tmp/"$CONVERTED"-formula + - pyenv global 3.8 + - pip install pre-commit==2.7.1 + - bin/install-hooks + - DEBUG=true bin/convert-formula.sh "$CONVERTED" - '[ $(git rev-list HEAD --count) -eq 2 ]' # Quick visual check that correct files have been updated - git show --pretty="" --name-status diff --git a/ssf/files/default/inspec/inspec.yml b/ssf/files/default/inspec/inspec.yml index 24ff3e4c..bbe4281b 100644 --- a/ssf/files/default/inspec/inspec.yml +++ b/ssf/files/default/inspec/inspec.yml @@ -7,7 +7,8 @@ maintainer: SaltStack Formulas license: Apache-2.0 {%- set summary_heading = 'summary: ' %} {%- set summary_chars = summary_heading | length + suite.inspec_yml.summary | length %} -{%- if summary_chars > yamllint.rules.get('line-length').max %} +{%- if (summary_chars > yamllint.rules.get('line-length').max) or + ([semrel_formula, suite.name] == ['TEMPLATE', 'default']) %} # yamllint disable-line rule:line-length {%- endif %} {{ summary_heading }}{{ suite.inspec_yml.summary }} diff --git a/ssf/files/default/pre-commit_semantic-release.sh b/ssf/files/default/pre-commit_semantic-release.sh index ba805352..458b7b64 100755 --- a/ssf/files/default/pre-commit_semantic-release.sh +++ b/ssf/files/default/pre-commit_semantic-release.sh @@ -11,7 +11,7 @@ sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA ############################################################################### # Install `m2r` -sudo -H pip install m2r +pip3 install m2r # Copy and then convert the `.md` docs cp ./*.md docs/ diff --git a/ssf/files/default/release.config.js b/ssf/files/default/release.config.js index 6af7aa8f..d7ba8b98 100644 --- a/ssf/files/default/release.config.js +++ b/ssf/files/default/release.config.js @@ -1,5 +1,6 @@ module.exports = { branch: 'master', + repositoryUrl: 'https://github.com/{{ owner }}/{{ formula }}', plugins: [ ['@semantic-release/commit-analyzer', { preset: 'angular', diff --git a/ssf/files/tofs_arvados-formula/.salt-lint b/ssf/files/tofs_arvados-formula/.salt-lint index 2389f56d..469c14e4 100644 --- a/ssf/files/tofs_arvados-formula/.salt-lint +++ b/ssf/files/tofs_arvados-formula/.salt-lint @@ -7,6 +7,7 @@ rules: ignore: | arvados/shell/config/files/default/shell-libpam-arvados.tmpl.jinja test/salt/pillar/examples/nginx_webshell_configuration.sls + test/salt/pillar/examples/nginx_passenger.sls skip_list: # Using `salt-lint` for linting other files as well, such as Jinja macros/templates - 205 # Use ".sls" as a Salt State file extension diff --git a/ssf/files/tofs_arvados-formula/kitchen.yml b/ssf/files/tofs_arvados-formula/kitchen.yml index b55392bb..53f989b3 100644 --- a/ssf/files/tofs_arvados-formula/kitchen.yml +++ b/ssf/files/tofs_arvados-formula/kitchen.yml @@ -55,6 +55,9 @@ platforms: - name: centos-7-3001-py3 driver: image: saltimages/salt-3001-py3:centos-7 + - name: amazonlinux-2-3001-py3 + driver: + image: saltimages/salt-3001-py3:amazonlinux-2 ## SALT `3000.3` - name: debian-10-3000-3-py3 @@ -100,18 +103,15 @@ suites: state_top: base: '*': - - example_add_snakeoil_certs + - single_host.host_entries + - single_host.snakeoil_certs - locale - nginx.passenger - postgres - arvados.repo - # - arvados.config - # - arvados.ruby - arvados.api - arvados.websocket - # keepproxy complains when using snakeoil certs, so we can't - # properly test it here until next version removes this limitation - # - arvados.keepproxy + - arvados.keepproxy - arvados.keepweb - arvados.controller - arvados.dispatcher @@ -129,7 +129,7 @@ suites: - example_nginx_controller # keepproxy expects to retrieve a list of services from API, so # installing/testing it without an api server running will fail - # - example_nginx_keepproxy + - example_nginx_keepproxy pillars_from_files: # yamllint disable rule:line-length arvados.sls: test/salt/pillar/arvados.sls @@ -139,12 +139,12 @@ suites: example_nginx_api.sls: test/salt/pillar/examples/nginx_api_configuration.sls example_nginx_websocket.sls: test/salt/pillar/examples/nginx_websocket_configuration.sls example_nginx_keepweb.sls: test/salt/pillar/examples/nginx_keepweb_configuration.sls - # example_nginx_keepproxy.sls: test/salt/pillar/examples/nginx_keepproxy_configuration.sls + example_nginx_keepproxy.sls: test/salt/pillar/examples/nginx_keepproxy_configuration.sls example_nginx_controller.sls: test/salt/pillar/examples/nginx_controller_configuration.sls # yamllint enable rule:line-length dependencies: - - name: example_add_snakeoil_certs - path: test/salt/states + - name: single_host + path: test/salt/states/examples - name: locale repo: git source: https://github.com/saltstack-formulas/locale-formula.git @@ -158,7 +158,7 @@ suites: inspec_tests: - path: test/integration/api - path: test/integration/websocket - # - path: test/integration/keepproxy + - path: test/integration/keepproxy - path: test/integration/keepweb - path: test/integration/controller @@ -170,7 +170,8 @@ suites: state_top: base: '*': - - example_add_snakeoil_certs + - single_host.host_entries + - single_host.snakeoil_certs - nginx.passenger - arvados.repo - arvados.workbench @@ -191,11 +192,11 @@ suites: example_nginx_workbench2.sls: test/salt/pillar/examples/nginx_workbench2_configuration.sls # yamllint enable rule:line-length dependencies: - - name: example_add_snakeoil_certs - path: test/salt/states + - name: single_host + path: test/salt/states/examples - name: nginx repo: git - source: https://github.com/saltstack-formulas/nginx-formula.git + source: https://github.com/netmanagers/nginx-formula.git verifier: inspec_tests: - path: test/integration/workbench diff --git a/ssf/files/tofs_docker-formula/.travis.yml b/ssf/files/tofs_docker-formula/.travis.yml new file mode 100644 index 00000000..2fd48fba --- /dev/null +++ b/ssf/files/tofs_docker-formula/.travis.yml @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +################################################################################ +# NOTE: This file is UNMAINTAINED; it is provided for references purposes only. +# No guarantees are tendered that this structure will work after 2020. +################################################################################ +# * https://en.wikipedia.org/wiki/Travis_CI: +# - "... free open-source plans were removed in [sic] the end of 2020" +# - https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing +# - https://ropensci.org/technotes/2020/11/19/moving-away-travis/ +################################################################################ +## Machine config +os: 'linux' +arch: 'amd64' +dist: 'bionic' +version: '~> 1.0' + +## Language and cache config +language: 'ruby' +cache: 'bundler' + +env: + global: + - CHANGE_MINIKUBE_NONE_USER=true + - MINIKUBE_WANTUPDATENOTIFICATION=false + - MINIKUBE_WANTREPORTERRORPROMPT=false + - MINIKUBE_HOME=$HOME + - CHANGE_MINIKUBE_NONE_USER=true + - KUBECONFIG=$HOME/.kube/config + +## Services config +services: + - docker + +## Script to run for the test stage +script: + - env + - bin/kitchen verify "${INSTANCE}" + +## Stages and jobs matrix +stages: + - test + # # As part of the switch away from Travis CI, ensure that the `release` stage + # # is not run inadvertently + # - name: 'release' + # if: 'branch = master AND type != pull_request' +jobs: + include: + ## Define the test stage that runs the linters (and testing matrix, if applicable) + + # Run all of the linters in a single job + - language: 'node_js' + node_js: 'lts/*' + env: 'Lint' + name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint' + before_install: 'skip' + script: + # Install and run `salt-lint` + - pip install --user salt-lint + - git ls-files -- '*.sls' '*.jinja' '*.j2' '*.tmpl' '*.tst' + | xargs salt-lint + # Install and run `yamllint` + # Need at least `v1.17.0` for the `yaml-files` setting + - pip install --user yamllint>=1.17.0 + - yamllint -s . + # Install and run `rubocop` + - gem install rubocop + - rubocop -d + # Run `shellcheck` (already pre-installed in Travis) + - shellcheck --version + - git ls-files -- '*.sh' '*.bash' '*.ksh' + | xargs shellcheck + # Install and run `commitlint` + - npm i -D @commitlint/config-conventional + @commitlint/travis-cli + - commitlint-travis + + # Run `pre-commit` linters in a single job + - language: 'python' + env: 'Lint_pre-commit' + name: 'Lint: pre-commit' + before_install: 'skip' + cache: + directories: + - $HOME/.cache/pre-commit + script: + # Install and run `pre-commit` + - pip install pre-commit==2.7.1 + - pre-commit run --all-files --color always --verbose + - pre-commit run --color always --hook-stage manual --verbose commitlint-travis + + ## 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` + # env: INSTANCE=archive-debian-10-master-py3 + - env: INSTANCE=package-debian-10-master-py3 + - env: INSTANCE=archive-ubuntu-1804-master-py3 + - env: INSTANCE=clean-ubuntu-1804-master-py3 + - env: INSTANCE=package-ubuntu-1804-master-py3 + - env: INSTANCE=archive-centos-8-master-py3 + - env: INSTANCE=package-centos-8-master-py3 + # env: INSTANCE=archive-fedora-31-master-py3 + - env: INSTANCE=package-fedora-31-master-py3 + - env: INSTANCE=archive-opensuse-leap-151-master-py3 + - env: INSTANCE=package-opensuse-leap-151-master-py3 + - env: INSTANCE=archive-amazonlinux-2-master-py3 + # env: INSTANCE=package-amazonlinux-2-master-py3 + # - env: INSTANCE=archive-debian-10-3000-2-py3 + # - env: INSTANCE=archive-debian-9-3000-2-py3 + # - env: INSTANCE=archive-ubuntu-1804-3000-2-py3 + # - env: INSTANCE=archive-centos-8-3000-2-py3 + # - env: INSTANCE=archive-centos-7-3000-2-py3 + # - env: INSTANCE=archive-fedora-31-3000-2-py3 + # - env: INSTANCE=archive-opensuse-leap-151-3000-2-py3 + # - env: INSTANCE=archive-amazonlinux-2-3000-2-py3 + # - env: INSTANCE=archive-ubuntu-1804-3000-2-py2 + # - env: INSTANCE=archive-ubuntu-1604-3000-2-py2 + # - env: INSTANCE=archive-archive-base-latest-3000-2-py2 + # - env: INSTANCE=archive-debian-10-2019-2-py3 + # - env: INSTANCE=archive-debian-9-2019-2-py3 + # - env: INSTANCE=archive-ubuntu-1804-2019-2-py3 + # - env: INSTANCE=archive-ubuntu-1604-2019-2-py3 + # - env: INSTANCE=archive-centos-8-2019-2-py3 + # - env: INSTANCE=archive-centos-7-2019-2-py3 + # - env: INSTANCE=archive-fedora-31-2019-2-py3 + # env: INSTANCE=archive-opensuse-leap-151-2019-2-py3 + # - env: INSTANCE=archive-amazonlinux-2-2019-2-py3 + # - env: INSTANCE=archive-centos-6-2019-2-py2 + # - env: INSTANCE=archive-amazonlinux-1-2019-2-py2 + - env: INSTANCE=archive-arch-base-latest-2019-2-py2 + - env: INSTANCE=package-arch-base-latest-2019-2-py2 + + ## Define the release stage that runs `semantic-release` + - stage: 'release' + language: 'node_js' + node_js: 'lts/*' + env: 'Release' + name: 'Run semantic-release inc. file updates to AUTHORS, CHANGELOG & FORMULA' + before_install: 'skip' + script: + # Update `AUTHORS.md` + - export MAINTAINER_TOKEN=${GH_TOKEN} + - go get github.com/myii/maintainer + - maintainer contributor + + # Install all dependencies required for `semantic-release` + - npm i -D @semantic-release/changelog@3 + @semantic-release/exec@3 + @semantic-release/git@7 + deploy: + provider: 'script' + # Opt-in to `dpl v2` to complete the Travis build config validation (beta) + # * https://docs.travis-ci.com/user/build-config-validation + # Deprecated `skip_cleanup` can now be avoided, `cleanup: false` is by default + edge: true + # Run `semantic-release` + script: 'npx semantic-release@15.14' + +# Notification options: `always`, `never` or `change` +notifications: + webhooks: + if: 'repo = saltstack-formulas/docker-formula' + urls: + - https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Fdocker-formula&ignore_pull_requests=true + on_success: always # default: always + on_failure: always # default: always + on_start: always # default: never + on_cancel: always # default: always + on_error: always # default: always diff --git a/ssf/files/tofs_docker-formula/kitchen.yml b/ssf/files/tofs_docker-formula/kitchen.yml new file mode 100644 index 00000000..eb08b516 --- /dev/null +++ b/ssf/files/tofs_docker-formula/kitchen.yml @@ -0,0 +1,301 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +# For help on this file's format, see https://kitchen.ci/ +driver: + name: docker + use_sudo: false + privileged: true + run_command: /lib/systemd/systemd + +# Make sure the platforms listed below match up with +# the `env.matrix` instances defined in `.travis.yml` +platforms: + ## SALT `master` + - name: debian-10-master-py3 + driver: + image: netmanagers/salt-master-py3:debian-10 + provision_command: + - apt-get -qq -y install conntrack + - name: ubuntu-1804-master-py3 + driver: + image: netmanagers/salt-master-py3:ubuntu-18.04 + provision_command: + - apt-get -qq -y install conntrack + - name: centos-8-master-py3 + driver: + image: netmanagers/salt-master-py3:centos-8 + provision_command: + - yum install conntrack-tools -y + - name: fedora-31-master-py3 + driver: + image: netmanagers/salt-master-py3:fedora-31 + provision_command: + - dnf install conntrack-tools -y + - name: opensuse-leap-151-master-py3 + driver: + image: netmanagers/salt-master-py3:opensuse-leap-15.1 + run_command: /usr/lib/systemd/systemd + provision_command: + - zypper --non-interactive install conntrack-tools + # Workaround to avoid intermittent failures on `opensuse-leap-15.1`: + # => SCP did not finish successfully (255): (Net::SCP::Error) + transport: + max_ssh_sessions: 1 + - name: amazonlinux-2-master-py3 + driver: + image: netmanagers/salt-master-py3:amazonlinux-2 + provision_command: + - yum install conntrack-tools -y + - name: arch-base-latest-master-py2 + driver: + image: netmanagers/salt-master-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd + provision_command: + - (test -x /usr/bin/pacman-mirrors && /usr/bin/pacman-mirrors -g) || true + - pacman -S --noconfirm conntrack-tools + + ## SALT `3000.1` + - name: debian-10-3000-1-py3 + driver: + image: netmanagers/salt-3000.1-py3:debian-10 + provision_command: + - apt-get -qq -y install conntrack + - name: ubuntu-1804-3000-1-py3 + driver: + image: netmanagers/salt-3000.1-py3:ubuntu-18.04 + provision_command: + - apt-get -qq -y install conntrack + - name: centos-8-3000-1-py3 + driver: + image: netmanagers/salt-3000.1-py3:centos-8 + provision_command: + - yum install conntrack-tools -y + - name: fedora-31-3000-1-py3 + driver: + image: netmanagers/salt-3000.1-py3:fedora-31 + provision_command: + - dnf install conntrack-tools -y + - name: opensuse-leap-151-3000-1-py3 + driver: + image: netmanagers/salt-3000.1-py3:opensuse-leap-15.1 + run_command: /usr/lib/systemd/systemd + provision_command: + - zypper --non-interactive install conntrack-tools + # Workaround to avoid intermittent failures on `opensuse-leap-15.1`: + # => SCP did not finish successfully (255): (Net::SCP::Error) + transport: + max_ssh_sessions: 1 + - name: amazonlinux-2-3000-1-py3 + driver: + image: netmanagers/salt-3000.1-py3:amazonlinux-2 + provision_command: + - yum install conntrack-tools -y + - name: arch-base-latest-3000-1-py2 + driver: + image: netmanagers/salt-3000.1-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd + provision_command: + - (test -x /usr/bin/pacman-mirrors && /usr/bin/pacman-mirrors -g) || true + - pacman -S --noconfirm conntrack-tools + + ## SALT `2019.2` + - name: debian-10-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:debian-10 + provision_command: + - apt-get -qq -y install conntrack + - name: debian-9-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:debian-9 + provision_command: + - apt-get -qq -y install conntrack + - name: ubuntu-1804-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:ubuntu-18.04 + provision_command: + - apt-get -qq -y install conntrack + - name: ubuntu-1604-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:ubuntu-16.04 + provision_command: + - apt-get -qq -y install conntrack + - name: centos-8-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:centos-8 + provision_command: + - yum install conntrack-tools -y + - name: centos-7-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:centos-7 + provision_command: + - yum install conntrack-tools -y + - name: fedora-31-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:fedora-31 + provision_command: + - yum install conntrack-tools -y + - name: opensuse-leap-151-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:opensuse-leap-15.1 + run_command: /usr/lib/systemd/systemd + provision_command: + - zypper --non-interactive install conntrack-tools + # Workaround to avoid intermittent failures on `opensuse-leap-15.1`: + # => SCP did not finish successfully (255): (Net::SCP::Error) + transport: + max_ssh_sessions: 1 + - name: amazonlinux-2-2019-2-py3 + driver: + image: netmanagers/salt-2019.2-py3:amazonlinux-2 + provision_command: + - yum install conntrack-tools -y + - name: ubuntu-1804-2019-2-py2 + driver: + image: netmanagers/salt-2019.2-py2:ubuntu-18.04 + provision_command: + - apt-get -qq -y install conntrack + - name: amazonlinux-1-2019-2-py2 + driver: + image: netmanagers/salt-2019.2-py2:amazonlinux-1 + run_command: /sbin/init + provision_command: + - yum install conntrack-tools -y + - name: arch-base-latest-2019-2-py2 + driver: + image: netmanagers/salt-2019.2-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd + provision_command: + - (test -x /usr/bin/pacman-mirrors && /usr/bin/pacman-mirrors -g) || true + - pacman -S --noconfirm conntrack-tools + + ## SALT `2018.3` + - name: centos-7-2018-3-py3 + driver: + image: netmanagers/salt-2018.3-py3:centos-7 + provision_command: + - yum install conntrack-tools -y + - name: fedora-30-2018-3-py3 + driver: + image: netmanagers/salt-2018.3-py3:fedora-30 + provision_command: + - yum install conntrack-tools -y + - name: debian-9-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:debian-9 + provision_command: + - apt-get -qq -y install conntrack + - name: debian-8-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:debian-8 + provision_command: + - apt-get -qq -y install conntrack + - name: ubuntu-1804-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:ubuntu-18.04 + provision_command: + - apt-get -qq -y install conntrack + - name: ubuntu-1604-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:ubuntu-16.04 + provision_command: + - apt-get -qq -y install conntrack + - name: centos-6-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:centos-6 + run_command: /sbin/init + provision_command: + - yum install conntrack-tools -y + - name: opensuse-leap-151-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:opensuse-leap-15.1 + run_command: /usr/lib/systemd/systemd + provision_command: + - zypper --non-interactive install conntrack-tools + # Workaround to avoid intermittent failures on `opensuse-leap-15.1`: + # => SCP did not finish successfully (255): (Net::SCP::Error) + transport: + max_ssh_sessions: 1 + - name: amazonlinux-1-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:amazonlinux-1 + run_command: /sbin/init + provision_command: + - yum install conntrack-tools -y + - name: arch-base-latest-2018-3-py2 + driver: + image: netmanagers/salt-2018.3-py2:arch-base-latest + run_command: /usr/lib/systemd/systemd + provision_command: + - (test -x /usr/bin/pacman-mirrors && /usr/bin/pacman-mirrors -g) || true + - pacman -S --noconfirm conntrack-tools + +provisioner: + name: salt_solo + log_level: debug + salt_install: none + require_chef: false + formula: docker + salt_copy_filter: + - .kitchen + - .git + +verifier: + # https://www.inspec.io/ + name: inspec + sudo: true + # cli, documentation, html, progress, json, json-min, json-rspec, junit + reporter: + - cli + +suites: + - name: archive + provisioner: + state_top: + base: + '*': + # docker.clean + - docker + pillars: + top.sls: + base: + '*': + - docker + pillars_from_files: + docker.sls: test/salt/pillar/archive.sls + verifier: + inspec_tests: + - path: test/integration/archive + - name: package + provisioner: + state_top: + base: + '*': + # docker.clean + - docker + pillars: + top.sls: + base: + '*': + - docker + pillars_from_files: + docker.sls: test/salt/pillar/package.sls + verifier: + inspec_tests: + - path: test/integration/package + - name: clean + provisioner: + state_top: + base: + '*': + - docker.clean + pillars: + top.sls: + base: + '*': + - docker + pillars_from_files: + docker.sls: test/salt/pillar/archive.sls + verifier: + inspec_tests: + - path: test/integration/clean diff --git a/ssf/files/tofs_ssf-formula/docs/CONTRIBUTING.rst b/ssf/files/tofs_ssf-formula/docs/CONTRIBUTING.rst new file mode 100644 index 00000000..23f3f22a --- /dev/null +++ b/ssf/files/tofs_ssf-formula/docs/CONTRIBUTING.rst @@ -0,0 +1,174 @@ +.. _contributing: + +How to contribute +================= + +This document will eventually outline all aspects of guidance to make your contributing experience a fruitful and enjoyable one. +What it already contains is information about *commit message formatting* and how that directly affects the numerous automated processes that are used for this repo. +It also covers how to contribute to this *formula's documentation*. + +.. contents:: **Table of Contents** + +Overview +-------- + +Submitting a pull request is more than just code! +To achieve a quality product, the *tests* and *documentation* need to be updated as well. +An excellent pull request will include these in the changes, wherever relevant. + +Commit message formatting +------------------------- + +Since every type of change requires making Git commits, +we will start by covering the importance of ensuring that all of your commit +messages are in the correct format. + +Automation of multiple processes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This formula uses `semantic-release `_ for automating numerous processes such as bumping the version number appropriately, creating new tags/releases and updating the changelog. +The entire process relies on the structure of commit messages to determine the version bump, which is then used for the rest of the automation. + +Full details are available in the upstream docs regarding the `Angular Commit Message Conventions `_. +The key factor is that the first line of the commit message must follow this format: + +.. code-block:: console + + type(scope): subject + + +* E.g. ``docs(contributing): add commit message formatting instructions``. + +Besides the version bump, the changelog and release notes are formatted accordingly. +So based on the example above: + +.. + + .. raw:: html + +

Documentation

+ + * **contributing:** add commit message formatting instructions + + +* The ``type`` translates into a ``Documentation`` sub-heading. +* The ``(scope):`` will be shown in bold text without the brackets. +* The ``subject`` follows the ``scope`` as standard text. + +pre-commit +^^^^^^^^^^ + +`pre-commit `_ is configured for this formula, which you may +optionally use to ease the steps involved in submitting your changes, including +checking the formatting of your commit messages. + +First install the ``pre-commit`` package manager locally using the appropriate +`method `_, then run ``bin/install-hooks`` in the +formula's root directory and now ``pre-commit`` will run automatically on each +``git commit``. :: + + $ bin/install-hooks + pre-commit installed at .git/hooks/pre-commit + pre-commit installed at .git/hooks/commit-msg + +Linting commit messages in Travis CI +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This formula uses `commitlint `_ for checking commit messages during CI testing. +This ensures that they are in accordance with the ``semantic-release`` settings. + +For more details about the default settings, refer back to the ``commitlint`` `reference rules `_. + +Relationship between commit type and version bump +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This formula applies some customisations to the defaults, as outlined in the table below, +based upon the `type `_ of the commit: + +.. list-table:: + :name: commit-type-vs-version-bump + :header-rows: 1 + :stub-columns: 0 + :widths: 1,2,3,1,1 + + * - Type + - Heading + - Description + - Bump (default) + - Bump (custom) + * - ``build`` + - Build System + - Changes related to the build system + - – + - + * - ``chore`` + - – + - Changes to the build process or auxiliary tools and libraries such as + documentation generation + - – + - + * - ``ci`` + - Continuous Integration + - Changes to the continuous integration configuration + - – + - + * - ``docs`` + - Documentation + - Documentation only changes + - – + - 0.0.1 + * - ``feat`` + - Features + - A new feature + - 0.1.0 + - + * - ``fix`` + - Bug Fixes + - A bug fix + - 0.0.1 + - + * - ``perf`` + - Performance Improvements + - A code change that improves performance + - 0.0.1 + - + * - ``refactor`` + - Code Refactoring + - A code change that neither fixes a bug nor adds a feature + - – + - 0.0.1 + * - ``revert`` + - Reverts + - A commit used to revert a previous commit + - – + - 0.0.1 + * - ``style`` + - Styles + - Changes that do not affect the meaning of the code (white-space, + formatting, missing semi-colons, etc.) + - – + - 0.0.1 + * - ``test`` + - Tests + - Adding missing or correcting existing tests + - – + - 0.0.1 + +Use ``BREAKING CHANGE`` to trigger a ``major`` version change +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Adding ``BREAKING CHANGE`` to the footer of the extended description of the commit message will **always** trigger a ``major`` version change, no matter which type has been used. +This will be appended to the changelog and release notes as well. +To preserve good formatting of these notes, the following format is prescribed: + +* ``BREAKING CHANGE: .`` + +An example of that: + +.. code-block:: git + + ... + + BREAKING CHANGE: With the removal of all of the `.sls` files under + `template package`, this formula no longer supports the installation of + packages. diff --git a/ssf/formulas.yaml b/ssf/formulas.yaml index 7ec2ad0d..8e6a0f56 100644 --- a/ssf/formulas.yaml +++ b/ssf/formulas.yaml @@ -613,8 +613,8 @@ ssf_node_anchors: - [ubuntu , 18.04, master, 3, default] - [debian , 9 , 2019.2, 3, default] - [ubuntu , 18.04, 2019.2, 3, default] - - [debian , 9 , 2018.3, 2, default] - - [ubuntu , 16.04, 2017.7, 2, default] + # # - [debian , 9 , 2018.3, 2, default] + # # - [ubuntu , 16.04, 2017.7, 2, default] platforms_matrix_osfamily_debian_new: &platforms_matrix_osfamily_debian_new # [os , os_ver, salt_ver, py_ver, inspec_suite] - [debian , 10 , master, 3, default] @@ -640,7 +640,7 @@ ssf_node_anchors: - [amazonlinux , 2 , 2019.2, 3, default] - [fedora , 30 , 2018.3, 3, default] # - [arch-base , latest, 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [centos , 6 , 2017.7, 2, default] platforms_matrix_without_arch_new: &platforms_matrix_without_arch_new # [os , os_ver, salt_ver, py_ver, inspec_suite] - [debian , 10 , master, 3, default] @@ -653,7 +653,7 @@ ssf_node_anchors: platforms_matrix_jetbrains: &platforms_matrix_jetbrains # [os , os_ver, salt_ver, py_ver, inspec_suite] - [debian , 10 , master, 3, default] - - [centos , 8 , master, 3, default] + # # - [centos , 8 , master, 3, default] - [fedora , 32 , master, 3, default] - [opensuse/leap, 15.2 , master, 3, default] - [arch-base , latest, 2019.2, 2, arch] @@ -697,6 +697,9 @@ ssf_node_anchors: .cirrus.yml: &file__--cirrus--yml <<: *file_default template: 'jinja' + .gitlab-ci.yml: &file__--gitlab-ci--yml + <<: *file_default + template: 'jinja' .pre-commit-config.yaml: &file__--pre-commit-config--yaml <<: *file_default template: 'jinja' @@ -733,6 +736,7 @@ ssf_node_anchors: <<: *file_default release.config.js: &file__release--config--js <<: *file_default + template: 'jinja' ssf: semrel_formulas: @@ -1073,10 +1077,12 @@ ssf: # # - [arch-base , latest, 3000.3, 2] platforms_matrix: # [os , os_ver, salt_ver, py_ver, inspec_suite] - - [ubuntu , 18.04, master, 3, workbench] - - [debian , 10 , 3001 , 3, api] - - [debian , 10 , 3001 , 3, shell] - - [ubuntu , 18.04, 3000.3, 2, keepstore] + # # - [ubuntu , 18.04, master, 3, workbench] + # # - [debian , 10 , 3001 , 3, api] + # - [debian , 10 , 3001 , 3, shell] + - [centos , 7 , 3001 , 3, shell] + # - [ubuntu , 18.04, 3000.3, 2, keepstore] + - [centos , 7 , 3000.3, 3, keepstore] use_tofs: true yamllint: ignore: @@ -1175,7 +1181,7 @@ ssf: # - [arch-base , latest, 2019.2, 2, default] - [fedora , 30 , 2018.3, 3, default] - [opensuse/leap, 15.1 , 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [centos , 6 , 2017.7, 2, default] semrel_files: *semrel_files_default consul: context: @@ -1239,14 +1245,14 @@ ssf: # # - [ubuntu , 20.04, master, 3, default] # # - [ubuntu , 18.04, master, 3, default] # # - [centos , 8 , master, 3, default] - - [fedora , 32 , master, 3, default] + # # - [fedora , 32 , master, 3, default] # # `make install` fails # # - [opensuse/leap, 15.2 , master, 3, default] # # - [debian , 9 , 3000.3, 3, default] - [ubuntu , 18.04, 3000.3, 3, default] - - [centos , 7 , 3000.3, 3, default] + # # - [centos , 7 , 3000.3, 3, default] - [opensuse/leap, 15.2 , 3000.3, 3, default] - - [fedora , 31 , 2019.2, 3, default] + # # - [fedora , 31 , 2019.2, 3, default] use_tofs: true semrel_files: *semrel_files_default devstack: @@ -1317,7 +1323,7 @@ ssf: - [amazonlinux , 2 , 3000.3, 3, default] # Was working but file comparison now tripping up on spaces on empty lines # - [centos , 7 , 2019.2, 3, default] - - [centos , 6 , 2019.2, 2, default] + # # - [centos , 6 , 2019.2, 2, default] # - [arch-base , latest, 2019.2, 2, default] semrel_files: *semrel_files_default django: @@ -1345,19 +1351,28 @@ ssf: inspec_yml: summary: >- Verify that the docker formula is setup and configured correctly - provisioner: - state_top: - - '*': - - . - - .containers - platforms_matrix: - # [os , os_ver, salt_ver, py_ver, inspec_suite] - - [debian , 10 , master, 3, default] - - [debian , 9 , 2019.2, 3, default] - - [ubuntu , 18.04, 2019.2, 3, default] - - [arch-base , latest, 2019.2, 2, default] - - [debian , 9 , 2018.3, 2, default] - - [ubuntu , 16.04, 2017.7, 2, default] + 1: + inspec_yml: + summary: >- + Verify that the docker formula is setup and configured correctly + 2: + inspec_yml: + summary: >- + Verify that the docker formula is setup and configured correctly + inspec_suites_matrix: + - archive + - package + - clean + # Linux testing not working on GitLab CI yet, last matrix shown below + platforms_matrix: [] + # # # [os , os_ver, salt_ver, py_ver, inspec_suite] + # # - [debian , 10 , master, 3, default] + # # - [debian , 9 , 2019.2, 3, default] + # # - [ubuntu , 18.04, 2019.2, 3, default] + # # - [arch-base , latest, 2019.2, 2, default] + # # - [debian , 9 , 2018.3, 2, default] + # # - [ubuntu , 16.04, 2017.7, 2, default] + use_tofs: true yamllint: ignore: additional: @@ -1404,10 +1419,10 @@ ssf: platforms: *platforms_new platforms_matrix: # [os , os_ver, salt_ver, py_ver, inspec_suite] - - [debian , 10 , master, 3, java] - - [centos , 8 , master, 3, java] - - [fedora , 32 , master, 3, javascript] - - [opensuse/leap, 15.2 , master, 3, cpp] + # # - [debian , 10 , master, 3, java] + # # - [centos , 8 , master, 3, java] + # # - [fedora , 32 , master, 3, javascript] + # # - [opensuse/leap, 15.2 , master, 3, cpp] # - [ubuntu , 18.04, 3000.3, 3, cpp] - [arch-base , latest, 2019.2, 2, java] # To deal with excessive instances when mimicking `kitchen list -b` @@ -1443,8 +1458,8 @@ ssf: - [amazonlinux , 2 , 2019.2, 3, default] - [centos , 7 , 2019.2, 2, default] # - [fedora , 30 , 2018.3, 3, default] - - [amazonlinux , 1 , 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [amazonlinux , 1 , 2018.3, 2, default] + # # - [centos , 6 , 2017.7, 2, default] semrel_files: *semrel_files_default exim: context: @@ -1495,7 +1510,7 @@ ssf: # - [fedora , 30 , 2018.3, 3, default] - [centos , 7 , 2018.3, 2, default] - [opensuse/leap, 15.1 , 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [centos , 6 , 2017.7, 2, default] semrel_files: *semrel_files_default firewalld: context: @@ -1649,7 +1664,9 @@ ssf: state_top: - '*': - .icinga-web2 - platforms_matrix: *platforms_matrix_osfamily_debian + # Linux testing not working on GitLab CI yet, last matrix shown below + platforms_matrix: [] + # platforms_matrix: *platforms_matrix_osfamily_debian yamllint: ignore: additional: @@ -1825,14 +1842,15 @@ ssf: - redhat - arch platforms: *platforms_new - platforms_matrix: - # [os , os_ver, salt_ver, py_ver, inspec_suite] - - [ubuntu , 18.04, master, 3, default] - - [centos , 8 , master, 3, redhat] - - [fedora , 32 , master, 3, redhat] - - [opensuse/leap, 15.2 , master, 3, default] - - [amazonlinux , 2 , master, 3, redhat] - # # - [arch-base , latest, 3000.3, 2, arch] + # Linux testing not working on GitLab CI yet, last matrix shown below + platforms_matrix: [] + # # # [os , os_ver, salt_ver, py_ver, inspec_suite] + # # - [ubuntu , 18.04, master, 3, default] + # # - [centos , 8 , master, 3, redhat] + # # - [fedora , 32 , master, 3, redhat] + # # - [opensuse/leap, 15.2 , master, 3, default] + # # - [amazonlinux , 2 , master, 3, redhat] + # # # # - [arch-base , latest, 3000.3, 2, arch] use_tofs: true yamllint: ignore: @@ -2512,6 +2530,16 @@ ssf: inspec_yml: summary: >- Verify that the keepalived formula is setup and configured correctly + platforms_matrix: + # [os , os_ver, salt_ver, py_ver, inspec_suite] + - [debian , 10 , master, 3, default] + - [ubuntu , 18.04, 2019.2, 3, default] + # # - [opensuse/leap, 15.1 , 2019.2, 3, default] + - [amazonlinux , 2 , 2019.2, 3, default] + # # - [fedora , 30 , 2018.3, 3, default] + # # - [arch-base , latest, 2018.3, 2, default] + # # - [centos , 6 , 2017.7, 2, default] + # TODO: Find appropriate use of `script_kitchen` & `travis` sections below script_kitchen: pre: - sudo modprobe ip_vs @@ -2689,7 +2717,7 @@ ssf: - [amazonlinux , 2 , 2019.2, 3, redhat] - [opensuse/leap, 15.1 , 2018.3, 2, default] - [arch-base , latest, 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [centos , 6 , 2017.7, 2, default] semrel_files: *semrel_files_default logrotate: context: @@ -2751,18 +2779,19 @@ ssf: inspec_suites_matrix: - loop4-loop5 - loop5-loop6 - platforms_matrix: - # Note, the commented lines are the only ones that didn't work - # Everything else working, even if lines have been removed - # Keeping hold of this "working out" for future reference - # One `#` where working but not using, two `# #` for not working at all - # Update: the lines the have been modified due to `2019.2.2` can no longer - # be guaranteed (i.e. working or not) - # [os , os_ver, salt_ver, py_ver, inspec_suite] - - [ubuntu , 18.04, master, 3, loop5-loop6] - - [centos , 8 , master, 3, loop5-loop6] - - [amazonlinux , 2 , 2019.2, 3, loop5-loop6] - - [opensuse/leap, 15.1 , 2018.3, 2, loop5-loop6] + # Linux testing not working on GitLab CI yet, last matrix shown below + platforms_matrix: [] + # # # Note, the commented lines are the only ones that didn't work + # # # Everything else working, even if lines have been removed + # # # Keeping hold of this "working out" for future reference + # # # One `#` where working but not using, two `# #` for not working at all + # # # Update: the lines the have been modified due to `2019.2.2` can no longer + # # # be guaranteed (i.e. working or not) + # # # [os , os_ver, salt_ver, py_ver, inspec_suite] + # # - [ubuntu , 18.04, master, 3, loop5-loop6] + # # - [centos , 8 , master, 3, loop5-loop6] + # # - [amazonlinux , 2 , 2019.2, 3, loop5-loop6] + # # - [opensuse/leap, 15.1 , 2018.3, 2, loop5-loop6] # To deal with excessive instances when mimicking `kitchen list -b` # If values are set, only use these as commented entries in the matrix platforms_matrix_commented_includes: @@ -2958,7 +2987,7 @@ ssf: - [debian , 10 , master, 3, default] # Not yet working with `20.04` - [ubuntu , 18.04, master, 3, default] - - [centos , 8 , master, 3, default] + # # - [centos , 8 , master, 3, default] # Not yet working with `32` - [fedora , 31 , master, 3, default] # - [opensuse/leap, 15.1 , master, 3, default] @@ -3044,7 +3073,7 @@ ssf: - [arch-base , latest, 2019.2, 2, default] - [fedora , 30 , 2018.3, 3, default] - [opensuse/leap, 15.1 , 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [centos , 6 , 2017.7, 2, default] travis: *travis_do_not_use_single_job_for_linters use_tofs: true semrel_files: *semrel_files_default @@ -3280,7 +3309,7 @@ ssf: # ... and PID file is not owned by root. Refusing. # # - [centos , 7 , 2019.2, 3, default] # - [fedora , 31 , 2019.2, 3, default] - - [centos , 6 , 2019.2, 2, default] + # # - [centos , 6 , 2019.2, 2, default] # Not configured at all for `arch-base` # https://wiki.archlinux.org/index.php/OpenLDAP # # - [arch-base , latest, 2019.2, 2, default] @@ -3599,7 +3628,7 @@ ssf: - [amazonlinux , 2 , 2019.2, 3, redhat] - [fedora , 30 , 2018.3, 3, redhat] - [opensuse/leap, 15.1 , 2018.3, 2, suse] - - [centos , 6 , 2017.7, 2, redhat] + # # - [centos , 6 , 2017.7, 2, redhat] travis: *travis_do_not_use_single_job_for_linters use_tofs: true semrel_files: *semrel_files_default @@ -3922,8 +3951,8 @@ ssf: - [ubuntu , 18.04, master, 3, default] - [debian , 9 , 2019.2, 3, default] - [ubuntu , 18.04, 2019.2, 3, default] - - [debian , 9 , 2018.3, 2, default] - - [ubuntu , 16.04, 2017.7, 2, default] + # # - [debian , 9 , 2018.3, 2, default] + # # - [ubuntu , 16.04, 2017.7, 2, default] semrel_files: *semrel_files_default redis: context: @@ -3938,7 +3967,7 @@ ssf: provisioner: state_top: - '*': - - . + - .common - .server platforms_matrix: # [os , os_ver, salt_ver, py_ver, inspec_suite] @@ -3947,9 +3976,9 @@ ssf: - [fedora , 31 , 2019.2, 3, default] # - [amazonlinux , 2 , 2019.2, 3, default] # - [arch-base , latest, 2019.2, 2, default] - - [debian , 9 , 2018.3, 2, default] - - [ubuntu , 16.04, 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [debian , 9 , 2018.3, 2, default] + # # - [ubuntu , 16.04, 2018.3, 2, default] + # # - [centos , 6 , 2017.7, 2, default] semrel_files: *semrel_files_default rkhunter: context: @@ -3995,7 +4024,7 @@ ssf: - [centos , 8 , 2019.2, 3, redhat] - [fedora , 30 , 2018.3, 3, redhat] - [opensuse/leap, 15.1 , 2018.3, 2, suse] - - [centos , 6 , 2017.7, 2, redhat] + # # - [centos , 6 , 2017.7, 2, redhat] travis: *travis_do_not_use_single_job_for_linters use_tofs: true semrel_files: *semrel_files_default @@ -4076,7 +4105,7 @@ ssf: # # - [amazonlinux , 2 , master, 3, default] - [centos , 7 , 3000.3, 3, default] - [arch-base , latest, 3000.3, 2, default] - - [centos , 6 , 2019.2, 2, default] + # # - [centos , 6 , 2019.2, 2, default] yamllint: ignore: additional: @@ -4143,7 +4172,7 @@ ssf: - [ubuntu , 18.04, 3000.3, 3] - [centos , 8 , 3000.3, 3] - [centos , 7 , 3000.3, 3] - - [fedora , 31 , 3000.3, 3] + # # - [fedora , 31 , 3000.3, 3] - [opensuse/leap, 15.2 , 3000.3, 3] - [amazonlinux , 2 , 3000.3, 3] - [oraclelinux , 8 , 3000.3, 3] @@ -4181,55 +4210,10 @@ ssf: - .sls: 'test/salt/pillar/salt.sls' - v3000-py2.sls: 'test/salt/pillar/v3000-py2.sls' state_top: *state_top_salt - 3: - includes: - # [os , os_ver, salt_ver, py_ver] - - [debian , 10 , 2019.2, 3] - - [debian , 9 , 2019.2, 3] - - [ubuntu , 18.04, 2019.2, 3] - - [ubuntu , 16.04, 2019.2, 3] - - [centos , 8 , 2019.2, 3] - - [centos , 7 , 2019.2, 3] - - [fedora , 31 , 2019.2, 3] - - [opensuse/leap, 15.2 , 2019.2, 3] - - [amazonlinux , 2 , 2019.2, 3] - inspec_yml: - summary: >- - Verify that Salt `v201902-py3` is setup and configured - supports: *supports_all_including_oracle_and_gentoo - provisioner: - pillars: - - '*': - - . - - v201902-py3 - pillars_from_files: - - .sls: 'test/salt/pillar/salt.sls' - - v201902-py3.sls: 'test/salt/pillar/v201902-py3.sls' - state_top: *state_top_salt - 4: - includes: - # [os , os_ver, salt_ver, py_ver] - - [centos , 6 , 2019.2, 2] - - [amazonlinux , 1 , 2019.2, 2] - inspec_yml: - summary: >- - Verify that Salt `v201902-py2` is setup and configured - supports: *supports_all_including_oracle_and_gentoo - provisioner: - pillars: - - '*': - - . - - v201902-py2 - pillars_from_files: - - .sls: 'test/salt/pillar/salt.sls' - - v201902-py2.sls: 'test/salt/pillar/v201902-py2.sls' - state_top: *state_top_salt inspec_suites_matrix: - v3001-py3 - v3000-py3 - v3000-py2 - - v201902-py3 - - v201902-py2 platforms: # [os , os_ver, salt_ver, py_ver] - [debian , 10 , 3001 , 3] @@ -4251,7 +4235,7 @@ ssf: - [ubuntu , 18.04, 3000.3, 3] - [centos , 8 , 3000.3, 3] - [centos , 7 , 3000.3, 3] - - [fedora , 31 , 3000.3, 3] + # # - [fedora , 31 , 3000.3, 3] - [opensuse/leap, 15.2 , 3000.3, 3] - [amazonlinux , 2 , 3000.3, 3] - [oraclelinux , 8 , 3000.3, 3] @@ -4293,26 +4277,13 @@ ssf: # - [ubuntu , 18.04, 3000.3, 3, v3000-py3] # - [centos , 8 , 3000.3, 3, v3000-py3] # - [centos , 7 , 3000.3, 3, v3000-py3] - - [fedora , 31 , 3000.3, 3, v3000-py3] + # # - [fedora , 31 , 3000.3, 3, v3000-py3] - [opensuse/leap, 15.2 , 3000.3, 3, v3000-py3] - [amazonlinux , 2 , 3000.3, 3, v3000-py3] # - [oraclelinux , 8 , 3000.3, 3, v3000-py3] - [oraclelinux , 7 , 3000.3, 3, v3000-py3] - [ubuntu , 18.04, 3000.3, 2, v3000-py2] # - [ubuntu , 16.04, 3000.3, 2, v3000-py2] - # - [debian , 10 , 2019.2, 3, v201902-py3] - - [debian , 9 , 2019.2, 3, v201902-py3] - # - [ubuntu , 18.04, 2019.2, 3, v201902-py3] - - [ubuntu , 16.04, 2019.2, 3, v201902-py3] - # - [centos , 8 , 2019.2, 3, v201902-py3] - - [centos , 7 , 2019.2, 3, v201902-py3] - # # Installs `3000.3` - # # - [fedora , 31 , 2019.2, 3, v201902-py3] - # - [opensuse/leap, 15.2 , 2019.2, 3, v201902-py3] - # - [amazonlinux , 2 , 2019.2, 3, v201902-py3] - - [centos , 6 , 2019.2, 2, v201902-py2] - # # States don't complete - # # - [amazonlinux , 1 , 2019.2, 2, v201902-py2] use_tofs: true yamllint: ignore: @@ -4393,6 +4364,8 @@ ssf: github: owner: 'myii' repo: 'ssf-formula' + gitlab: + owner: 'myii' inspec_suites_kitchen: 0: inspec_yml: @@ -4410,6 +4383,7 @@ ssf: ignore: additional: - ssf/files/default/.cirrus.yml + - ssf/files/default/.gitlab-ci.yml - ssf/files/default/.pre-commit-config.yaml - ssf/files/default/.rubocop.yml - ssf/files/default/.salt-lint @@ -4431,6 +4405,7 @@ ssf: docs/TOFS_pattern.rst: *file__docs__TOFS_pattern--rst formula/libtofs.jinja: *file__formula__libtofs--jinja .gitignore: *file__--gitignore + .gitlab-ci.yml: *file__--gitlab-ci--yml .pre-commit-config.yaml: *file__--pre-commit-config--yaml .rstcheck.cfg: *file__--rstcheck--cfg .rubocop.yml: *file__--rubocop--yml @@ -4523,7 +4498,7 @@ ssf: - [ubuntu , 18.04, master, 3, default] - [debian , 9 , 2019.2, 3, default] - [ubuntu , 18.04, 2019.2, 3, default] - - [debian , 9 , 2018.3, 2, default] + # # - [debian , 9 , 2018.3, 2, default] semrel_files: *semrel_files_default sudoers: context: @@ -4602,7 +4577,7 @@ ssf: - [centos , 8 , 3001 , 3, default] - [ubuntu , 18.04, 3000.3, 3, default] - [ubuntu , 16.04, 3000.3, 2, default] - - [centos , 7 , 2019.2, 3, default] + # # - [centos , 7 , 2019.2, 3, default] yamllint: ignore: additional: @@ -4737,8 +4712,8 @@ ssf: - [fedora , 31 , master, 3, default] - [ubuntu , 18.04, 2019.2, 3, default] - [centos , 7 , 2019.2, 2, default] - - [debian , 9 , 2018.3, 2, default] - - [ubuntu , 16.04, 2018.3, 2, default] + # # - [debian , 9 , 2018.3, 2, default] + # # - [ubuntu , 16.04, 2018.3, 2, default] use_tofs: true semrel_files: *semrel_files_default template: @@ -4892,7 +4867,7 @@ ssf: - [gentoo/stage3, latest, master, 3, gentoo] - [gentoo/stage3, systemd, master, 3, gentoo] - [arch-base , latest, 3000.3, 2, default] - - [centos , 6 , 2019.2, 2, upstart] + # # - [centos , 6 , 2019.2, 2, upstart] - [amazonlinux , 1 , 2019.2, 2, upstart] use_libsaltcli: true use_tofs: true @@ -4970,7 +4945,8 @@ ssf: - [fedora , 32 , master, 3, default] - [opensuse/leap, 15.2 , 3000.3, 3, default] - [amazonlinux , 2 , 3000.3, 3, default] - - [debian , 9 , 2019.2, 3, default] + # # Broken with recent PR (#119?) + # # - [debian , 9 , 2019.2, 3, default] - [centos , 7 , 2019.2, 3, default] # Tomcat appears to require an older version of JVM on Arch # yamllint disable-line rule:line-length @@ -5088,7 +5064,7 @@ ssf: - [amazonlinux , 2 , 2019.2, 3, default] - [fedora , 30 , 2018.3, 3, default] # - [arch-base , latest, 2018.3, 2, default] - - [centos , 6 , 2017.7, 2, default] + # # - [centos , 6 , 2017.7, 2, default] # To deal with excessive instances when mimicking `kitchen list -b` # If values are set, only use these as commented entries in the matrix platforms_matrix_commented_includes: @@ -5130,7 +5106,7 @@ ssf: repo: 'varnish-formula' inspec_suites_kitchen: 0: - excludes: *platforms_osfamily_suse_new + excludes: *platforms_osfamily_suse_new_15_2 inspec_yml: summary: >- Verify that the varnish formula is setup and configured correctly @@ -5146,7 +5122,7 @@ ssf: - '*': - .ng 1: - includes: *platforms_osfamily_suse_new + includes: *platforms_osfamily_suse_new_15_2 provisioner: pillars: - '*': @@ -5165,11 +5141,11 @@ ssf: platforms: *platforms_new platforms_matrix: # [os , os_ver, salt_ver, py_ver, inspec_suite] - - [debian , 10 , master, 3, default] + # # - [debian , 10 , master, 3, default] - [centos , 8 , master, 3, default] - - [ubuntu , 18.04, 3000.3, 3, default] + # # - [ubuntu , 18.04, 3000.3, 3, default] - [opensuse/leap, 15.2 , 3000.3, 3, suse] - - [amazonlinux , 2 , 3000.3, 3, default] + # # - [amazonlinux , 2 , 3000.3, 3, default] - [fedora , 31 , 2019.2, 3, default] - [arch-base , latest, 2019.2, 2, default] # TODO: Upgrade to latest TOFS in a subsequent PR, since a legacy version @@ -5227,7 +5203,7 @@ ssf: - [fedora , 32 , master, 3, prod_server] - [opensuse/leap, 15.2 , 3000.3, 3, prod_server] - [amazonlinux , 2 , 3000.3, 3, prod_server] - - [arch-base , latest, 2019.2, 2, prod_server] + # # - [arch-base , latest, 2019.2, 2, prod_server] # To deal with excessive instances when mimicking `kitchen list -b` # If values are set, only use these as commented entries in the matrix platforms_matrix_commented_includes: diff --git a/ssf/libcimatrix.jinja b/ssf/libcimatrix.jinja index 478f7dbe..25dd6e6e 100644 --- a/ssf/libcimatrix.jinja +++ b/ssf/libcimatrix.jinja @@ -9,7 +9,8 @@ platforms_matrix_commented_includes, semrel_formula, width=4, - use_new_travis_format=False + use_new_travis_format=False, + use_gitlab_format=False ) %} {%- filter indent(width) %} {#- Centralise duplication from here and `kitchen.yml` #} @@ -57,10 +58,20 @@ {%- set include_instance = False %} {%- endif %} {%- endif %} -{#- Define `instance_and_env`, modified for new Travis format #} +{#- Define `instance_and_env`, modified for new Travis format or GitLab format #} {%- set instance_and_env = 'INSTANCE: ' %} {%- if use_new_travis_format %} {%- set instance_and_env = 'env: INSTANCE=' %} +{%- elif use_gitlab_format %} +{%- set instance_and_env = '' %} +{%- endif %} +{#- Define GitLab-specific formats #} +{%- if use_gitlab_format %} +{%- set list_format = '' %} +{%- set test_template = ": {extends: '.test_instance'}" %} +{%- else %} +{%- set list_format = '- ' %} +{%- set test_template = "" %} {%- endif %} {%- if include_instance %} {#- Only add a prefix if suite_name is given #} @@ -80,7 +91,7 @@ and [suite_name, os, os_ver, salt_ver] == ['default', 'amazonlinux', 2, 'master'] %} # https://community.letsencrypt.org/t/localhost-crt-does-not-exist-or-is-empty/103979 {%- endif %} -{{ comment }}- {{ instance_and_env }}{{ instance }} +{{ comment }}{{ list_format }}{{ instance_and_env }}{{ instance }}{{ test_template }} {%- endif %} {%- endif %} {%- endif %}