From 4ee6763bedd8b1b302611e04fffd2677531a443e Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 14 Jul 2019 05:21:21 +0100 Subject: [PATCH] chore: use `semantic-release` cross-formula standard structure * Automated using `ssf-formula` (v0.1.0-rc.1) --- .gitignore | 9 ++++++ .travis.yml | 27 +++++------------ Gemfile | 1 - deepsea/libtofs.jinja | 13 +++++---- docs/CONTRIBUTING.rst | 1 + kitchen.yml | 45 +++++++++++++---------------- test/integration/default/README.md | 4 +-- test/integration/default/inspec.yml | 8 +++-- 8 files changed, 51 insertions(+), 57 deletions(-) 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 88bfda2..1b9c149 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- stages: - test - commitlint @@ -7,25 +10,13 @@ stages: sudo: required cache: bundler language: ruby +dist: xenial services: - docker -dist: xenial - # 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: default-debian-9-develop-py3 @@ -42,19 +33,15 @@ env: # - INSTANCE: default-ubuntu-1604-2018-3-py2 # - INSTANCE: default-centos-7-2018-3-py2 - INSTANCE: default-fedora-29-2018-3-py2 - # TODO: Use this when fixed instead of `opensuse-leap-42` - # Ref: https://github.com/netmanagers/salt-image-builder/issues/2 - # - INSTANCE: default-opensuse-leap-15-2018-3-py2 - INSTANCE: default-opensuse-leap-42-2018-3-py2 # - INSTANCE: default-debian-8-2017-7-py2 # - INSTANCE: default-ubuntu-1604-2017-7-py2 - # TODO: Enable after improving the formula to work with other than `systemd` - #- INSTANCE: default-centos-6-2017-7-py2 + # - INSTANCE: default-centos-6-2017-7-py2 # - INSTANCE: default-fedora-28-2017-7-py2 - #- INSTANCE: default-opensuse-leap-42-2017-7-py2 + # - INSTANCE: default-opensuse-leap-42-2017-7-py2 script: - - bundle exec kitchen verify ${INSTANCE} + - bin/kitchen verify ${INSTANCE} jobs: include: diff --git a/Gemfile b/Gemfile index 2346e07..3b36de3 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,4 @@ source "https://rubygems.org" gem 'kitchen-docker', '>= 2.9' gem 'kitchen-salt', '>= 0.6.0' gem 'kitchen-inspec', '>= 1.1' -gem 'net-ssh', '>= 5.2.0' diff --git a/deepsea/libtofs.jinja b/deepsea/libtofs.jinja index ab0d0f6..da656a5 100644 --- a/deepsea/libtofs.jinja +++ b/deepsea/libtofs.jinja @@ -87,12 +87,13 @@ {%- else %} {%- set fs_dir = salt['config.get'](tplroot ~ ':tofs:dirs:default', 'default') %} {%- endif %} - {%- set url = '- salt://' ~ '/'.join([ - path_prefix_inc_ext, - files_dir, - fs_dir, - src_file.lstrip('/') - ]) %} + {%- set url = [ + '- salt:/', + path_prefix_inc_ext.strip('/'), + files_dir.strip('/'), + fs_dir.strip('/'), + src_file.strip('/'), + ] | select | join('/') %} {{ url | indent(indent_width, true) }} {%- endfor %} {%- endfor %} 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 25a2abc..23022b5 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -29,15 +29,15 @@ platforms: image: netmanagers/salt-develop-py3:centos-7 provision_command: - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com - - yum install make -y - sh bootstrap-salt.sh -XdPbfrq -x python3 git develop + - yum install make -y - name: fedora-29-develop-py3 driver: image: netmanagers/salt-develop-py3:fedora-29 provision_command: - - yum install make -y - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com - sh bootstrap-salt.sh -XdPbfrq -x python3 git develop + - yum install make -y - name: opensuse-leap-15-develop-py3 driver: image: netmanagers/salt-develop-py3:opensuse-leap-15 @@ -47,7 +47,7 @@ platforms: - zypper -n in tar gzip run_command: /usr/lib/systemd/systemd - ## SALT 2019.2 + ## SALT `2019.2` - name: debian-9-2019-2-py3 driver: image: netmanagers/salt-2019.2-py3:debian-9 @@ -67,7 +67,7 @@ platforms: - zypper -n in tar gzip run_command: /usr/lib/systemd/systemd - ## SALT 2018.3 + ## SALT `2018.3` - name: debian-9-2018-3-py2 driver: image: netmanagers/salt-2018.3-py2:debian-9 @@ -80,12 +80,6 @@ platforms: - name: fedora-29-2018-3-py2 driver: image: netmanagers/salt-2018.3-py2:fedora-29 - # TODO: Use this when fixed instead of `opensuse-leap-42` - # Ref: https://github.com/netmanagers/salt-image-builder/issues/2 - # - name: opensuse-leap-15-2018-3-py2 - # driver: - # image: netmanagers/salt-2018.3-py2:opensuse-leap-15 - # run_command: /usr/lib/systemd/systemd - name: opensuse-leap-42-2018-3-py2 driver: image: netmanagers/salt-2018.3-py2:opensuse-leap-42 @@ -93,14 +87,13 @@ platforms: - zypper -n in tar gzip run_command: /usr/lib/systemd/systemd - ## SALT 2017.7 + ## SALT `2017.7` - name: debian-8-2017-7-py2 driver: image: netmanagers/salt-2017.7-py2:debian-8 - name: ubuntu-1604-2017-7-py2 driver: image: netmanagers/salt-2017.7-py2:ubuntu-16.04 - # TODO: Modify the formula to work for non-`systemd` platforms - name: centos-6-2017-7-py2 driver: image: netmanagers/salt-2017.7-py2:centos-6 @@ -124,17 +117,6 @@ provisioner: salt_copy_filter: - .kitchen - .git - state_top: - base: - '*': - - deepsea - pillars: - top.sls: - base: - '*': - - deepsea - pillars_from_files: - deepsea.sls: pillar.example verifier: # https://www.inspec.io/ @@ -143,8 +125,21 @@ verifier: # cli, documentation, html, progress, json, json-min, json-rspec, junit reporter: - cli - inspec_tests: - - path: test/integration/default suites: - name: default + provisioner: + state_top: + base: + '*': + - deepsea + pillars: + top.sls: + base: + '*': + - deepsea + pillars_from_files: + deepsea.sls: pillar.example + verifier: + inspec_tests: + - path: test/integration/default diff --git a/test/integration/default/README.md b/test/integration/default/README.md index 8019607..37cf963 100644 --- a/test/integration/default/README.md +++ b/test/integration/default/README.md @@ -1,6 +1,6 @@ -# Default InSpec Profile +# InSpec Profile: `default` -This shows the implementation of the Default InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). +This shows the implementation of the `default` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). ## Verify a profile diff --git a/test/integration/default/inspec.yml b/test/integration/default/inspec.yml index be653d0..65cd574 100644 --- a/test/integration/default/inspec.yml +++ b/test/integration/default/inspec.yml @@ -1,6 +1,6 @@ -name: deepsea -title: deepsea Formula -maintainer: Saltstack Formulas Community +name: default +title: deepsea formula +maintainer: SaltStack Formulas license: Apache-2.0 summary: Verify that the deepsea formula is setup and configured correctly supports: @@ -9,4 +9,6 @@ supports: - platform-name: centos - platform-name: fedora - platform-name: opensuse + - platform-name: suse - platform-name: freebsd + - platform-name: amazon