From f6eb546174da72cb743483c091b6c1b30a4adba6 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 2 Oct 2020 22:34:13 +0100 Subject: [PATCH] chore: standardise structure [skip ci] * Automated using https://github.com/myii/ssf-formula/pull/261 --- .travis.yml | 21 ++++----------------- .yamllint | 7 +++---- kitchen.yml | 10 ---------- pre-commit_semantic-release.sh | 5 +---- prometheus/libtofs.jinja | 2 +- release.config.js | 2 +- test/salt/pillar/repo.sls | 1 + 7 files changed, 11 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 91cebf8..a7edc73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,17 +65,7 @@ jobs: ## 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` - # NOTE: Please try to select up to six instances that add some meaningful - # testing of the formula's behaviour. If possible, try to refrain from - # the classical "chosing all the instances because I want to test on - # another/all distro/s" trap: it will just add time to the testing (see - # the discussion on #121). As an example, the set chosen below covers - # the most used distros families, systemd and non-systemd and the latest - # three supported Saltstack versions with python2 and 3. - # As for `kitchen.yml`, that should still contain all of the platforms, - # to allow for comprehensive local testing - # Ref: https://github.com/saltstack-formulas/template-formula/issues/118 - # Ref: https://github.com/saltstack-formulas/template-formula/issues/121 + - env: INSTANCE=default-debian-10-master-py3 - env: INSTANCE=default-ubuntu-2004-master-py3 # - env: INSTANCE=default-ubuntu-1804-master-py3 - env: INSTANCE=default-centos-8-master-py3 @@ -84,15 +74,15 @@ jobs: # - env: INSTANCE=default-opensuse-leap-152-master-py3 # - env: INSTANCE=default-amazonlinux-2-master-py3 # - env: INSTANCE=default-debian-10-3000-3-py3 - # - env: INSTANCE=default-debian-9-3000-3-py3 + - env: INSTANCE=repo-debian-10-3000-3-py3 + - env: INSTANCE=default-debian-9-3000-3-py3 # - env: INSTANCE=default-ubuntu-1804-3000-3-py3 # - env: INSTANCE=default-centos-8-3000-3-py3 # - env: INSTANCE=default-centos-7-3000-3-py3 + - env: INSTANCE=repo-centos-7-3000-3-py3 # - env: INSTANCE=default-fedora-31-3000-3-py3 - env: INSTANCE=default-opensuse-leap-152-3000-3-py3 - env: INSTANCE=default-amazonlinux-2-3000-3-py3 - - env: INSTANCE=default-debian-10-3001-py3 - - env: INSTANCE=default-debian-9-3001-py3 # - env: INSTANCE=default-ubuntu-1804-3000-3-py2 # - env: INSTANCE=default-ubuntu-1604-3000-3-py2 # - env: INSTANCE=default-arch-base-latest-3000-3-py2 @@ -108,9 +98,6 @@ jobs: # - env: INSTANCE=default-centos-6-2019-2-py2 # - env: INSTANCE=default-amazonlinux-1-2019-2-py2 - env: INSTANCE=default-arch-base-latest-2019-2-py2 - # REPO - - env: INSTANCE=repo-debian-10-3000-3-py3 - - env: INSTANCE=repo-centos-7-3000-3-py3 ## Define the release stage that runs `semantic-release` - stage: 'release' diff --git a/.yamllint b/.yamllint index ad379ab..9a3881a 100644 --- a/.yamllint +++ b/.yamllint @@ -10,11 +10,9 @@ extends: default # 3. Any YAML files under directory `.kitchen/`, introduced during local testing ignore: | node_modules/ - test/**/*.sls + test/**/states/**/*.sls .kitchen/ - bin/kitchen prometheus/osfamilymap.yaml - pillar.example yaml-files: # Default settings @@ -24,6 +22,7 @@ yaml-files: - .yamllint # SaltStack Formulas additional settings - '*.example' + - test/**/*.sls rules: empty-values: @@ -32,7 +31,7 @@ rules: line-length: # Increase from default of `80` # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) - max: 98 + max: 88 octal-values: forbid-implicit-octal: true forbid-explicit-octal: true diff --git a/kitchen.yml b/kitchen.yml index c172ce5..3311a22 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -42,14 +42,6 @@ platforms: driver: image: saltimages/salt-master-py3:amazonlinux-2 - ## SALT `3001` - - name: debian-10-3001-py3 - driver: - image: saltimages/salt-3001-py3:debian-10 - - name: debian-9-3001-py3 - driver: - image: saltimages/salt-3001-py3:debian-9 - ## SALT `3000.3` - name: debian-10-3000-3-py3 driver: @@ -163,7 +155,6 @@ suites: state_top: base: '*': - # prometheus.clean - prometheus pillars: top.sls: @@ -182,7 +173,6 @@ suites: state_top: base: '*': - # prometheus.clean - prometheus pillars: top.sls: diff --git a/pre-commit_semantic-release.sh b/pre-commit_semantic-release.sh index 516ef6d..ba80535 100755 --- a/pre-commit_semantic-release.sh +++ b/pre-commit_semantic-release.sh @@ -13,9 +13,6 @@ sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA # Install `m2r` sudo -H pip install m2r -# working directory -MYPWD=$( pwd ) - # Copy and then convert the `.md` docs cp ./*.md docs/ cd docs/ || exit @@ -30,4 +27,4 @@ sed -i -e '1,4s/-/=/g' CHANGELOG.rst # cat CHANGELOG.rst # Return back to the main directory -cd "${MYPWD}" || exit +cd .. diff --git a/prometheus/libtofs.jinja b/prometheus/libtofs.jinja index 00033cb..f39fd42 100644 --- a/prometheus/libtofs.jinja +++ b/prometheus/libtofs.jinja @@ -112,4 +112,4 @@ {%- endfor %} {%- endfor %} {%- endfor %} -{%- endmacro %} \ No newline at end of file +{%- endmacro %} diff --git a/release.config.js b/release.config.js index afa0cb1..6af7aa8 100644 --- a/release.config.js +++ b/release.config.js @@ -63,7 +63,7 @@ module.exports = { } if (typeof commit.hash === `string`) { - commit.hash = commit.hash.substring(0, 7) + commit.shortHash = commit.hash.substring(0, 7) } if (typeof commit.subject === `string`) { diff --git a/test/salt/pillar/repo.sls b/test/salt/pillar/repo.sls index f9bdd15..57067b3 100644 --- a/test/salt/pillar/repo.sls +++ b/test/salt/pillar/repo.sls @@ -29,6 +29,7 @@ prometheus: smartctl: /usr/sbin/smartctl pkg: + # yamllint disable-line rule:braces rule:commas use_upstream_repo: {{ false if grains.os_family|lower in ('debian',) else true }} use_upstream_archive: false