ci(gitlab-ci): use GitLab CI as Travis CI replacement
authorImran Iqbal <iqbalmy@hotmail.com>
Wed, 16 Dec 2020 06:27:48 +0000 (06:27 +0000)
committerImran Iqbal <iqbalmy@hotmail.com>
Wed, 16 Dec 2020 06:27:48 +0000 (06:27 +0000)
* Automated using https://github.com/myii/ssf-formula/pull/275

.gitlab-ci.yml [new file with mode: 0644]
.travis.yml
.yamllint
CODEOWNERS
kitchen.yml
pre-commit_semantic-release.sh
release.config.js

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..b59f360
--- /dev/null
@@ -0,0 +1,197 @@
+# -*- 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/arvados-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']
+  image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14'
+  # `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'
+
+###############################################################################
+# `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'
+
+###############################################################################
+# 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`
+# api-debian-10-tiamat-py3: {extends: '.test_instance'}
+# keepstore-debian-10-tiamat-py3: {extends: '.test_instance'}
+# shell-debian-10-tiamat-py3: {extends: '.test_instance'}
+# workbench-debian-10-tiamat-py3: {extends: '.test_instance'}
+# api-debian-9-tiamat-py3: {extends: '.test_instance'}
+# keepstore-debian-9-tiamat-py3: {extends: '.test_instance'}
+# shell-debian-9-tiamat-py3: {extends: '.test_instance'}
+# workbench-debian-9-tiamat-py3: {extends: '.test_instance'}
+# api-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
+# keepstore-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
+# shell-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
+# workbench-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}
+# api-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
+# keepstore-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
+# shell-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
+# workbench-ubuntu-1804-tiamat-py3: {extends: '.test_instance'}
+# api-centos-7-tiamat-py3: {extends: '.test_instance'}
+# keepstore-centos-7-tiamat-py3: {extends: '.test_instance'}
+# shell-centos-7-tiamat-py3: {extends: '.test_instance'}
+# workbench-centos-7-tiamat-py3: {extends: '.test_instance'}
+# api-debian-10-master-py3: {extends: '.test_instance'}
+# keepstore-debian-10-master-py3: {extends: '.test_instance'}
+# shell-debian-10-master-py3: {extends: '.test_instance'}
+# workbench-debian-10-master-py3: {extends: '.test_instance'}
+# api-ubuntu-2004-master-py3: {extends: '.test_instance'}
+# keepstore-ubuntu-2004-master-py3: {extends: '.test_instance'}
+# shell-ubuntu-2004-master-py3: {extends: '.test_instance'}
+# workbench-ubuntu-2004-master-py3: {extends: '.test_instance'}
+# api-ubuntu-1804-master-py3: {extends: '.test_instance'}
+# keepstore-ubuntu-1804-master-py3: {extends: '.test_instance'}
+# shell-ubuntu-1804-master-py3: {extends: '.test_instance'}
+# workbench-ubuntu-1804-master-py3: {extends: '.test_instance'}
+# api-debian-10-3001-py3: {extends: '.test_instance'}
+# keepstore-debian-10-3001-py3: {extends: '.test_instance'}
+# shell-debian-10-3001-py3: {extends: '.test_instance'}
+# workbench-debian-10-3001-py3: {extends: '.test_instance'}
+# api-debian-9-3001-py3: {extends: '.test_instance'}
+# keepstore-debian-9-3001-py3: {extends: '.test_instance'}
+# shell-debian-9-3001-py3: {extends: '.test_instance'}
+# workbench-debian-9-3001-py3: {extends: '.test_instance'}
+# api-ubuntu-2004-3001-py3: {extends: '.test_instance'}
+# keepstore-ubuntu-2004-3001-py3: {extends: '.test_instance'}
+# shell-ubuntu-2004-3001-py3: {extends: '.test_instance'}
+# workbench-ubuntu-2004-3001-py3: {extends: '.test_instance'}
+# api-ubuntu-1804-3001-py3: {extends: '.test_instance'}
+# keepstore-ubuntu-1804-3001-py3: {extends: '.test_instance'}
+# shell-ubuntu-1804-3001-py3: {extends: '.test_instance'}
+# workbench-ubuntu-1804-3001-py3: {extends: '.test_instance'}
+# api-centos-7-3001-py3: {extends: '.test_instance'}
+# keepstore-centos-7-3001-py3: {extends: '.test_instance'}
+shell-centos-7-3001-py3: {extends: '.test_instance'}
+# workbench-centos-7-3001-py3: {extends: '.test_instance'}
+# api-debian-10-3000-3-py3: {extends: '.test_instance'}
+# keepstore-debian-10-3000-3-py3: {extends: '.test_instance'}
+# shell-debian-10-3000-3-py3: {extends: '.test_instance'}
+# workbench-debian-10-3000-3-py3: {extends: '.test_instance'}
+# api-debian-9-3000-3-py3: {extends: '.test_instance'}
+# keepstore-debian-9-3000-3-py3: {extends: '.test_instance'}
+# shell-debian-9-3000-3-py3: {extends: '.test_instance'}
+# workbench-debian-9-3000-3-py3: {extends: '.test_instance'}
+# api-ubuntu-1804-3000-3-py3: {extends: '.test_instance'}
+# keepstore-ubuntu-1804-3000-3-py3: {extends: '.test_instance'}
+# shell-ubuntu-1804-3000-3-py3: {extends: '.test_instance'}
+# workbench-ubuntu-1804-3000-3-py3: {extends: '.test_instance'}
+# api-centos-7-3000-3-py3: {extends: '.test_instance'}
+keepstore-centos-7-3000-3-py3: {extends: '.test_instance'}
+# shell-centos-7-3000-3-py3: {extends: '.test_instance'}
+# workbench-centos-7-3000-3-py3: {extends: '.test_instance'}
+# api-ubuntu-1804-3000-3-py2: {extends: '.test_instance'}
+# keepstore-ubuntu-1804-3000-3-py2: {extends: '.test_instance'}
+# shell-ubuntu-1804-3000-3-py2: {extends: '.test_instance'}
+# workbench-ubuntu-1804-3000-3-py2: {extends: '.test_instance'}
+
+###############################################################################
+# `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'
index ba356a29ef2146c2ee7bd1bd253de2e5b5596b85..273f12b5e39ac865dc2b6dbf0f51f76a8bd78d80 100644 (file)
@@ -1,6 +1,15 @@
 # -*- coding: utf-8 -*-
 # vim: ft=yaml
 ---
 # -*- 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'
 ## Machine config
 os: 'linux'
 arch: 'amd64'
@@ -22,8 +31,10 @@ script:
 ## Stages and jobs matrix
 stages:
   - test
 ## 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:
   include:
     ## Define the test stage that runs the linters (and testing matrix, if applicable)
 jobs:
   include:
     ## Define the test stage that runs the linters (and testing matrix, if applicable)
@@ -103,8 +114,8 @@ jobs:
     # - env: INSTANCE=api-ubuntu-1804-master-py3
     # - env: INSTANCE=keepstore-ubuntu-1804-master-py3
     # - env: INSTANCE=shell-ubuntu-1804-master-py3
     # - env: INSTANCE=api-ubuntu-1804-master-py3
     # - env: INSTANCE=keepstore-ubuntu-1804-master-py3
     # - env: INSTANCE=shell-ubuntu-1804-master-py3
-    - env: INSTANCE=workbench-ubuntu-1804-master-py3
-    - env: INSTANCE=api-debian-10-3001-py3
+    - env: INSTANCE=workbench-ubuntu-1804-master-py3
+    - env: INSTANCE=api-debian-10-3001-py3
     # - env: INSTANCE=keepstore-debian-10-3001-py3
     # - env: INSTANCE=shell-debian-10-3001-py3
     # - env: INSTANCE=workbench-debian-10-3001-py3
     # - env: INSTANCE=keepstore-debian-10-3001-py3
     # - env: INSTANCE=shell-debian-10-3001-py3
     # - env: INSTANCE=workbench-debian-10-3001-py3
index 241d51caff44583571efad5138ecd24d6d84f014..3227fb8b1ff1773eda8727acfc3f3b22eca42eb0 100644 (file)
--- a/.yamllint
+++ b/.yamllint
@@ -9,6 +9,7 @@ extends: default
 # 2. Any SLS files under directory `test/`, which are actually state files
 # 3. Any YAML files under directory `.kitchen/`, introduced during local testing
 ignore: |
 # 2. Any SLS files under directory `test/`, which are actually state files
 # 3. Any YAML files under directory `.kitchen/`, introduced during local testing
 ignore: |
+  .cache/
   node_modules/
   test/**/states/**/*.sls
   .kitchen/
   node_modules/
   test/**/states/**/*.sls
   .kitchen/
index e9b234b09fb40fbeb11e267577daaba8e214b0a0..45ca6c69f6b6fcdbbb7bb4418871b44c0e77ff1f 100644 (file)
 /docs/AUTHORS.rst                           @saltstack-formulas/ssf
 /docs/CHANGELOG.rst                         @saltstack-formulas/ssf
 /docs/TOFS_pattern.rst                      @saltstack-formulas/ssf
 /docs/AUTHORS.rst                           @saltstack-formulas/ssf
 /docs/CHANGELOG.rst                         @saltstack-formulas/ssf
 /docs/TOFS_pattern.rst                      @saltstack-formulas/ssf
-/arvados/libsaltcli.jinja                   @saltstack-formulas/ssf
-/arvados/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
 /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
 /.pre-commit-config.yaml                    @saltstack-formulas/ssf
 /.rstcheck.cfg                              @saltstack-formulas/ssf
 /.rubocop.yml                               @saltstack-formulas/ssf
index f2e0addc0d84e78b008afe67df02d3c37dafcc77..53f989b309f1bcd34ab55fdb570485f151237397 100644 (file)
@@ -39,10 +39,6 @@ platforms:
     driver:
       image: saltimages/salt-master-py3:ubuntu-18.04
 
     driver:
       image: saltimages/salt-master-py3:ubuntu-18.04
 
-  - name: amazonlinux-2-3001-py3
-    driver:
-      image: saltimages/salt-3001-py3:amazonlinux-2
-
   ## SALT `3001`
   - name: debian-10-3001-py3
     driver:
   ## SALT `3001`
   - name: debian-10-3001-py3
     driver:
@@ -59,6 +55,9 @@ platforms:
   - name: centos-7-3001-py3
     driver:
       image: saltimages/salt-3001-py3:centos-7
   - 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
 
   ## SALT `3000.3`
   - name: debian-10-3000-3-py3
index ba8053520b2795e3cc870440537a2e388f73d5fa..458b7b649cd0de1ca91b446cf9de26e00ab0d87d 100755 (executable)
@@ -11,7 +11,7 @@ sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA
 ###############################################################################
 
 # Install `m2r`
 ###############################################################################
 
 # Install `m2r`
-sudo -H pip install m2r
+pip3 install m2r
 
 # Copy and then convert the `.md` docs
 cp ./*.md docs/
 
 # Copy and then convert the `.md` docs
 cp ./*.md docs/
index 6af7aa8f046665bd6128abae3afa7c030a7c1301..00412e850130ef7a36bcf8b4ee956bbf1ece7139 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   branch: 'master',
 module.exports = {
   branch: 'master',
+  repositoryUrl: 'https://github.com/saltstack-formulas/arvados-formula',
   plugins: [
       ['@semantic-release/commit-analyzer', {
         preset: 'angular',
   plugins: [
       ['@semantic-release/commit-analyzer', {
         preset: 'angular',