From a088ca5ac1eadf72d1091008ba3366c771915830 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 28 Jun 2019 08:24:43 +0100 Subject: [PATCH 1/6] ci(kitchen+travis): modify matrix to include `develop` platform --- .travis.yml | 4 ++++ kitchen.yml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1895415..5c7f6ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,8 +26,12 @@ services: # Ref: https://github.com/saltstack-formulas/template-formula/issues/121 env: matrix: + - INSTANCE: repositories-debian-9-develop-py3 + # - INSTANCE: repositories-ubuntu-1804-develop-py3 - INSTANCE: repositories-debian-9-2019-2-py3 - INSTANCE: repositories-ubuntu-1804-2019-2-py3 + - INSTANCE: preferences-debian-9-develop-py3 + # - INSTANCE: preferences-ubuntu-1804-develop-py3 - INSTANCE: preferences-debian-9-2019-2-py3 - INSTANCE: preferences-ubuntu-1804-2019-2-py3 diff --git a/kitchen.yml b/kitchen.yml index 697b5f6..74bd568 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -11,6 +11,21 @@ driver: # Make sure the platforms listed below match up with # the `env.matrix` instances defined in `.travis.yml` platforms: + ## SALT `develop` + - name: debian-9-develop-py3 + driver: + image: netmanagers/salt-develop-py3:debian-9 + provision_command: + - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com + - sh bootstrap-salt.sh -XdPbfrq -x python3 git develop + - name: ubuntu-1804-develop-py3 + driver: + image: netmanagers/salt-develop-py3:ubuntu-18.04 + provision_command: + - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com + - sh bootstrap-salt.sh -XdPbfrq -x python3 git develop + + ## SALT 2019.2 - name: debian-9-2019-2-py3 driver: image: netmanagers/salt-2019.2-py3:debian-9 From 5879b8462ead003bfd1f227031155692e9a6d469 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 14 Jul 2019 05:06:24 +0100 Subject: [PATCH 2/6] chore: use `semantic-release` cross-formula standard structure * Automated using `ssf-formula` (v0.1.0-rc.1) --- .gitignore | 9 +++++ .travis.yml | 20 +++------- docs/CONTRIBUTING.rst | 1 + kitchen.yml | 17 +++++--- test/integration/preferences/README.md | 50 ++++++++++++++++++++++++ test/integration/preferences/inspec.yml | 8 ++-- test/integration/repositories/README.md | 50 ++++++++++++++++++++++++ test/integration/repositories/inspec.yml | 8 ++-- 8 files changed, 134 insertions(+), 29 deletions(-) create mode 100644 test/integration/preferences/README.md create mode 100644 test/integration/repositories/README.md diff --git a/.gitignore b/.gitignore index ba07ed8..0bbb03c 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ coverage.xml .kitchen .kitchen.local.yml kitchen.local.yml +junit-*.xml # Translations *.mo @@ -111,3 +112,11 @@ docs/*.md # Vim *.sw? + +## Collected when centralising formulas (check and sort) +# `collectd-formula` +.pytest_cache/ +/.idea/ +Dockerfile.*_* +ignore/ +tmp/ diff --git a/.travis.yml b/.travis.yml index 5c7f6ef..44a6003 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,36 +7,26 @@ stages: sudo: required cache: bundler language: ruby +dist: xenial services: - docker # 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: matrix: - INSTANCE: repositories-debian-9-develop-py3 - # - INSTANCE: repositories-ubuntu-1804-develop-py3 - - INSTANCE: repositories-debian-9-2019-2-py3 - - INSTANCE: repositories-ubuntu-1804-2019-2-py3 - INSTANCE: preferences-debian-9-develop-py3 + # - INSTANCE: repositories-ubuntu-1804-develop-py3 # - INSTANCE: preferences-ubuntu-1804-develop-py3 + - INSTANCE: repositories-debian-9-2019-2-py3 - INSTANCE: preferences-debian-9-2019-2-py3 + - INSTANCE: repositories-ubuntu-1804-2019-2-py3 - INSTANCE: preferences-ubuntu-1804-2019-2-py3 script: - - bundle exec kitchen verify ${INSTANCE} + - bin/kitchen verify ${INSTANCE} jobs: include: diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst index 5da9ae8..b7da8f4 100644 --- a/docs/CONTRIBUTING.rst +++ b/docs/CONTRIBUTING.rst @@ -156,3 +156,4 @@ 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/kitchen.yml b/kitchen.yml index 74bd568..0753908 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -25,7 +25,7 @@ platforms: - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com - sh bootstrap-salt.sh -XdPbfrq -x python3 git develop - ## SALT 2019.2 + ## SALT `2019.2` - name: debian-9-2019-2-py3 driver: image: netmanagers/salt-2019.2-py3:debian-9 @@ -42,11 +42,6 @@ provisioner: salt_copy_filter: - .kitchen - .git - pillars: - top.sls: - base: - '*': - - apt verifier: # https://www.inspec.io/ @@ -64,6 +59,11 @@ suites: '*': - apt.repositories - apt.update + pillars: + top.sls: + base: + '*': + - apt pillars_from_files: apt.sls: test/salt/pillar/repositories.pillar.sls verifier: @@ -75,6 +75,11 @@ suites: base: '*': - apt.preferences + pillars: + top.sls: + base: + '*': + - apt pillars_from_files: apt.sls: test/salt/pillar/preferences.pillar.sls verifier: diff --git a/test/integration/preferences/README.md b/test/integration/preferences/README.md new file mode 100644 index 0000000..fddca69 --- /dev/null +++ b/test/integration/preferences/README.md @@ -0,0 +1,50 @@ +# InSpec Profile: `preferences` + +This shows the implementation of the `preferences` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). + +## Verify a profile + +InSpec ships with built-in features to verify a profile structure. + +```bash +$ inspec check preferences +Summary +------- +Location: preferences +Profile: profile +Controls: 4 +Timestamp: 2019-06-24T23:09:01+00:00 +Valid: true + +Errors +------ + +Warnings +-------- +``` + +## Execute a profile + +To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. + +```bash +$ inspec exec preferences +.. + +Finished in 0.0025 seconds (files took 0.12449 seconds to load) +8 examples, 0 failures +``` + +## Execute a specific control from a profile + +To run one control from the profile use `inspec exec /path/to/profile --controls name`. + +```bash +$ inspec exec preferences --controls package +. + +Finished in 0.0025 seconds (files took 0.12449 seconds to load) +1 examples, 0 failures +``` + +See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). diff --git a/test/integration/preferences/inspec.yml b/test/integration/preferences/inspec.yml index a32e354..0e5fb71 100644 --- a/test/integration/preferences/inspec.yml +++ b/test/integration/preferences/inspec.yml @@ -1,8 +1,8 @@ name: preferences -title: Apt Formula -maintainer: Saltstack-formulas org +title: apt formula +maintainer: SaltStack Formulas license: Apache-2.0 summary: Verify that the apt preferences are configured correctly supports: - - os-name: debian - - os-name: ubuntu + - platform-name: debian + - platform-name: ubuntu diff --git a/test/integration/repositories/README.md b/test/integration/repositories/README.md new file mode 100644 index 0000000..319631e --- /dev/null +++ b/test/integration/repositories/README.md @@ -0,0 +1,50 @@ +# InSpec Profile: `repositories` + +This shows the implementation of the `repositories` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). + +## Verify a profile + +InSpec ships with built-in features to verify a profile structure. + +```bash +$ inspec check repositories +Summary +------- +Location: repositories +Profile: profile +Controls: 4 +Timestamp: 2019-06-24T23:09:01+00:00 +Valid: true + +Errors +------ + +Warnings +-------- +``` + +## Execute a profile + +To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. + +```bash +$ inspec exec repositories +.. + +Finished in 0.0025 seconds (files took 0.12449 seconds to load) +8 examples, 0 failures +``` + +## Execute a specific control from a profile + +To run one control from the profile use `inspec exec /path/to/profile --controls name`. + +```bash +$ inspec exec repositories --controls package +. + +Finished in 0.0025 seconds (files took 0.12449 seconds to load) +1 examples, 0 failures +``` + +See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb). diff --git a/test/integration/repositories/inspec.yml b/test/integration/repositories/inspec.yml index 7fa5acb..5b58b4b 100644 --- a/test/integration/repositories/inspec.yml +++ b/test/integration/repositories/inspec.yml @@ -1,8 +1,8 @@ name: repositories -title: Apt Formula -maintainer: Saltstack-formulas org +title: apt formula +maintainer: SaltStack Formulas license: Apache-2.0 summary: Verify that the apt repositories are configured correctly supports: - - os-name: debian - - os-name: ubuntu + - platform-name: debian + - platform-name: ubuntu From aa6375877e76efbe6a9158d6e84868077f7055de Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 30 Jul 2019 09:04:30 +0100 Subject: [PATCH 3/6] chore: use `semantic-release` cross-formula standard structure * Automated using `ssf-formula` (v0.1.0-rc.3) --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 44a6003..02d86de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- stages: - test - commitlint From 03d15e9acb49c4c1636396439265dfd53bc9fec6 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 6 Aug 2019 20:58:14 +0100 Subject: [PATCH 4/6] feat(yamllint): include for this repo and apply rules throughout * Semi-automated using `ssf-formula` (v0.5.0) * Fix errors shown below: ```bash apt-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:") pillar.example 7:1 error trailing spaces (trailing-spaces) test/salt/pillar/repositories.pillar.sls 1:1 warning missing document start "---" (document-start) 19:1 error too many blank lines (1 > 0) (empty-lines) test/salt/pillar/preferences.pillar.sls 1:1 warning missing document start "---" (document-start) ``` --- .travis.yml | 13 +++++++++---- .yamllint | 16 ++++++++++++++++ pillar.example | 2 +- test/integration/preferences/inspec.yml | 3 +++ test/integration/repositories/inspec.yml | 3 +++ test/salt/pillar/preferences.pillar.sls | 3 +++ test/salt/pillar/repositories.pillar.sls | 4 +++- 7 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 .yamllint diff --git a/.travis.yml b/.travis.yml index 02d86de..7239ea1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ --- stages: - test - - commitlint + - lint - name: release if: branch = master AND type != pull_request @@ -33,16 +33,21 @@ script: jobs: include: - # Define the commitlint stage - - stage: commitlint + # Define the `lint` stage (runs `yamllint` and `commitlint`) + - stage: lint language: node_js node_js: lts/* before_install: skip script: + # Install and run `yamllint` + - pip install --user yamllint + # yamllint disable-line rule:line-length + - yamllint -s . .yamllint pillar.example test/salt/pillar/repositories.pillar.sls test/salt/pillar/preferences.pillar.sls + # Install and run `commitlint` - npm install @commitlint/config-conventional -D - npm install @commitlint/travis-cli -D - commitlint-travis - # Define the release stage that runs semantic-release + # Define the release stage that runs `semantic-release` - stage: release language: node_js node_js: lts/* diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..3a90f57 --- /dev/null +++ b/.yamllint @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +# Extend the `default` configuration provided by `yamllint` +extends: default + +# Files to ignore completely +# 1. All YAML files under directory `node_modules/`, introduced during the Travis run +ignore: | + node_modules/ + +rules: + line-length: + # Increase from default of `80` + # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`) + max: 88 diff --git a/pillar.example b/pillar.example index 1fb1288..7d5bef2 100644 --- a/pillar.example +++ b/pillar.example @@ -4,7 +4,7 @@ apt: # Set the right keyring for the distro (ie ubuntu-keyring or ...) keyring_package: debian-archive-keyring - + remove_sources_list: true clean_sources_list_d: true diff --git a/test/integration/preferences/inspec.yml b/test/integration/preferences/inspec.yml index 0e5fb71..f4cb7a4 100644 --- a/test/integration/preferences/inspec.yml +++ b/test/integration/preferences/inspec.yml @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- name: preferences title: apt formula maintainer: SaltStack Formulas diff --git a/test/integration/repositories/inspec.yml b/test/integration/repositories/inspec.yml index 5b58b4b..5cda415 100644 --- a/test/integration/repositories/inspec.yml +++ b/test/integration/repositories/inspec.yml @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- name: repositories title: apt formula maintainer: SaltStack Formulas diff --git a/test/salt/pillar/preferences.pillar.sls b/test/salt/pillar/preferences.pillar.sls index f207765..ba42d6a 100644 --- a/test/salt/pillar/preferences.pillar.sls +++ b/test/salt/pillar/preferences.pillar.sls @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- apt: remove_preferences: true clean_preferences_d: true diff --git a/test/salt/pillar/repositories.pillar.sls b/test/salt/pillar/repositories.pillar.sls index 142b878..3487665 100644 --- a/test/salt/pillar/repositories.pillar.sls +++ b/test/salt/pillar/repositories.pillar.sls @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- apt: remove_sources_list: true clean_sources_list_d: true @@ -16,4 +19,3 @@ apt: arch: [amd64] comps: [] key_url: https://cli-assets.heroku.com/apt/release.key - From 00c936b023202487def060da6f14ef14ab0ae36c Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 7 Aug 2019 20:05:29 +0100 Subject: [PATCH 5/6] fix(repositories): update spotify repo key --- apt/repositories.sls | 2 ++ test/salt/pillar/repositories.pillar.sls | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apt/repositories.sls b/apt/repositories.sls index 08614f2..dd866bf 100644 --- a/apt/repositories.sls +++ b/apt/repositories.sls @@ -69,6 +69,8 @@ the latter will be used. #} {% if args.key_url is defined %} - key_url: {{ args.key_url }} + {% elif args.key_text is defined %} + - key_text: {{ args.key_text }} {% elif args.keyid is defined %} - keyid: {{ args.keyid }} - keyserver: {{ r_keyserver }} diff --git a/test/salt/pillar/repositories.pillar.sls b/test/salt/pillar/repositories.pillar.sls index 142b878..d90c68a 100644 --- a/test/salt/pillar/repositories.pillar.sls +++ b/test/salt/pillar/repositories.pillar.sls @@ -8,7 +8,7 @@ apt: url: http://repository.spotify.com arch: [amd64] comps: [non-free] - keyid: 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90 + keyid: 2EBF997C15BDA244B6EBF5D84773BD5E130D1D45 keyserver: keyserver.ubuntu.com heroku: distro: ./ From f15c64debc036d4c51735db5a83379e14c5dea5e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 7 Aug 2019 19:52:14 +0000 Subject: [PATCH 6/6] chore(release): 0.9.0 [skip ci] # [0.9.0](https://github.com/saltstack-formulas/apt-formula/compare/v0.8.1...v0.9.0) (2019-08-07) ### Bug Fixes * **repositories:** update spotify repo key ([00c936b](https://github.com/saltstack-formulas/apt-formula/commit/00c936b)) ### Continuous Integration * **kitchen+travis:** modify matrix to include `develop` platform ([a088ca5](https://github.com/saltstack-formulas/apt-formula/commit/a088ca5)) ### Features * **yamllint:** include for this repo and apply rules throughout ([03d15e9](https://github.com/saltstack-formulas/apt-formula/commit/03d15e9)) --- AUTHORS.md | 6 +++--- CHANGELOG.md | 17 +++++++++++++++++ FORMULA | 2 +- docs/AUTHORS.rst | 10 +++++----- docs/CHANGELOG.rst | 21 +++++++++++++++++++++ 5 files changed, 47 insertions(+), 9 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 73ac1fd..2fd3855 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -4,9 +4,10 @@ This list is sorted by the number of commits per contributor in _descending_ ord Avatar|Contributor|Contributions :-:|---|:-: -@javierbertoli|[@javierbertoli](https://github.com/javierbertoli)|22 +@javierbertoli|[@javierbertoli](https://github.com/javierbertoli)|26 @gravyboat|[@gravyboat](https://github.com/gravyboat)|12 @bmcclure|[@bmcclure](https://github.com/bmcclure)|8 +@myii|[@myii](https://github.com/myii)|8 @arthurlogilab|[@arthurlogilab](https://github.com/arthurlogilab)|7 @nmadhok|[@nmadhok](https://github.com/nmadhok)|7 @boltronics|[@boltronics](https://github.com/boltronics)|5 @@ -17,7 +18,6 @@ Avatar|Contributor|Contributions @techhat|[@techhat](https://github.com/techhat)|3 @whiteinge|[@whiteinge](https://github.com/whiteinge)|3 @devster31|[@devster31](https://github.com/devster31)|3 -@myii|[@myii](https://github.com/myii)|2 @jerrykan|[@jerrykan](https://github.com/jerrykan)|1 @rpatterson|[@rpatterson](https://github.com/rpatterson)|1 @simonclausen|[@simonclausen](https://github.com/simonclausen)|1 @@ -25,4 +25,4 @@ Avatar|Contributor|Contributions --- -Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-05-28. +Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-08-07. diff --git a/CHANGELOG.md b/CHANGELOG.md index a240fd5..b2d9956 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +# [0.9.0](https://github.com/saltstack-formulas/apt-formula/compare/v0.8.1...v0.9.0) (2019-08-07) + + +### Bug Fixes + +* **repositories:** update spotify repo key ([00c936b](https://github.com/saltstack-formulas/apt-formula/commit/00c936b)) + + +### Continuous Integration + +* **kitchen+travis:** modify matrix to include `develop` platform ([a088ca5](https://github.com/saltstack-formulas/apt-formula/commit/a088ca5)) + + +### Features + +* **yamllint:** include for this repo and apply rules throughout ([03d15e9](https://github.com/saltstack-formulas/apt-formula/commit/03d15e9)) + ## [0.8.1](https://github.com/saltstack-formulas/apt-formula/compare/v0.8.0...v0.8.1) (2019-05-28) diff --git a/FORMULA b/FORMULA index 72bfb96..4028edf 100644 --- a/FORMULA +++ b/FORMULA @@ -1,7 +1,7 @@ name: apt os: Debian, Ubuntu, Raspbian os_family: Debian -version: 0.8.1 +version: 0.9.0 release: 1 minimum_version: 2017.7 summary: Apt formula diff --git a/docs/AUTHORS.rst b/docs/AUTHORS.rst index ff3e4a8..eef6b8c 100644 --- a/docs/AUTHORS.rst +++ b/docs/AUTHORS.rst @@ -15,13 +15,16 @@ This list is sorted by the number of commits per contributor in *descending* ord - Contributions * - :raw-html-m2r:`@javierbertoli` - `@javierbertoli `_ - - 22 + - 26 * - :raw-html-m2r:`@gravyboat` - `@gravyboat `_ - 12 * - :raw-html-m2r:`@bmcclure` - `@bmcclure `_ - 8 + * - :raw-html-m2r:`@myii` + - `@myii `_ + - 8 * - :raw-html-m2r:`@arthurlogilab` - `@arthurlogilab `_ - 7 @@ -52,9 +55,6 @@ This list is sorted by the number of commits per contributor in *descending* ord * - :raw-html-m2r:`@devster31` - `@devster31 `_ - 3 - * - :raw-html-m2r:`@myii` - - `@myii `_ - - 2 * - :raw-html-m2r:`@jerrykan` - `@jerrykan `_ - 1 @@ -71,4 +71,4 @@ This list is sorted by the number of commits per contributor in *descending* ord ---- -Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2019-05-28. +Auto-generated by a `forked version `_ of `gaocegege/maintainer `_ on 2019-08-07. diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 1c1d64e..21cfab1 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -2,6 +2,27 @@ Changelog ========= +`0.9.0 `_ (2019-08-07) +----------------------------------------------------------------------------------------------------- + +Bug Fixes +^^^^^^^^^ + + +* **repositories:** update spotify repo key (\ `00c936b `_\ ) + +Continuous Integration +^^^^^^^^^^^^^^^^^^^^^^ + + +* **kitchen+travis:** modify matrix to include ``develop`` platform (\ `a088ca5 `_\ ) + +Features +^^^^^^^^ + + +* **yamllint:** include for this repo and apply rules throughout (\ `03d15e9 `_\ ) + `0.8.1 `_ (2019-05-28) -----------------------------------------------------------------------------------------------------