Browse Source

chore: use `semantic-release` cross-formula standard structure

* Automated using `ssf-formula` (v0.1.0-rc.1)
tags/v0.9.0
Imran Iqbal 5 years ago
parent
commit
5879b8462e
8 changed files with 134 additions and 29 deletions
  1. +9
    -0
      .gitignore
  2. +5
    -15
      .travis.yml
  3. +1
    -0
      docs/CONTRIBUTING.rst
  4. +11
    -6
      kitchen.yml
  5. +50
    -0
      test/integration/preferences/README.md
  6. +4
    -4
      test/integration/preferences/inspec.yml
  7. +50
    -0
      test/integration/repositories/README.md
  8. +4
    -4
      test/integration/repositories/inspec.yml

+ 9
- 0
.gitignore View File

.kitchen .kitchen
.kitchen.local.yml .kitchen.local.yml
kitchen.local.yml kitchen.local.yml
junit-*.xml


# Translations # Translations
*.mo *.mo


# Vim # Vim
*.sw? *.sw?

## Collected when centralising formulas (check and sort)
# `collectd-formula`
.pytest_cache/
/.idea/
Dockerfile.*_*
ignore/
tmp/

+ 5
- 15
.travis.yml View File

sudo: required sudo: required
cache: bundler cache: bundler
language: ruby language: ruby
dist: xenial


services: services:
- docker - docker


# Make sure the instances listed below match up with # Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml` # 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: env:
matrix: matrix:
- INSTANCE: repositories-debian-9-develop-py3 - 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-debian-9-develop-py3
# - INSTANCE: repositories-ubuntu-1804-develop-py3
# - INSTANCE: preferences-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: preferences-debian-9-2019-2-py3
- INSTANCE: repositories-ubuntu-1804-2019-2-py3
- INSTANCE: preferences-ubuntu-1804-2019-2-py3 - INSTANCE: preferences-ubuntu-1804-2019-2-py3


script: script:
- bundle exec kitchen verify ${INSTANCE}
- bin/kitchen verify ${INSTANCE}


jobs: jobs:
include: include:

+ 1
- 0
docs/CONTRIBUTING.rst View File

BREAKING CHANGE: With the removal of all of the `.sls` files under BREAKING CHANGE: With the removal of all of the `.sls` files under
`template package`, this formula no longer supports the installation of `template package`, this formula no longer supports the installation of
packages. packages.


+ 11
- 6
kitchen.yml View File

- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com - curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop - sh bootstrap-salt.sh -XdPbfrq -x python3 git develop


## SALT 2019.2
## SALT `2019.2`
- name: debian-9-2019-2-py3 - name: debian-9-2019-2-py3
driver: driver:
image: netmanagers/salt-2019.2-py3:debian-9 image: netmanagers/salt-2019.2-py3:debian-9
salt_copy_filter: salt_copy_filter:
- .kitchen - .kitchen
- .git - .git
pillars:
top.sls:
base:
'*':
- apt


verifier: verifier:
# https://www.inspec.io/ # https://www.inspec.io/
'*': '*':
- apt.repositories - apt.repositories
- apt.update - apt.update
pillars:
top.sls:
base:
'*':
- apt
pillars_from_files: pillars_from_files:
apt.sls: test/salt/pillar/repositories.pillar.sls apt.sls: test/salt/pillar/repositories.pillar.sls
verifier: verifier:
base: base:
'*': '*':
- apt.preferences - apt.preferences
pillars:
top.sls:
base:
'*':
- apt
pillars_from_files: pillars_from_files:
apt.sls: test/salt/pillar/preferences.pillar.sls apt.sls: test/salt/pillar/preferences.pillar.sls
verifier: verifier:

+ 50
- 0
test/integration/preferences/README.md View File

# 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).

+ 4
- 4
test/integration/preferences/inspec.yml View File

name: preferences name: preferences
title: Apt Formula
maintainer: Saltstack-formulas org
title: apt formula
maintainer: SaltStack Formulas
license: Apache-2.0 license: Apache-2.0
summary: Verify that the apt preferences are configured correctly summary: Verify that the apt preferences are configured correctly
supports: supports:
- os-name: debian
- os-name: ubuntu
- platform-name: debian
- platform-name: ubuntu

+ 50
- 0
test/integration/repositories/README.md View File

# 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).

+ 4
- 4
test/integration/repositories/inspec.yml View File

name: repositories name: repositories
title: Apt Formula
maintainer: Saltstack-formulas org
title: apt formula
maintainer: SaltStack Formulas
license: Apache-2.0 license: Apache-2.0
summary: Verify that the apt repositories are configured correctly summary: Verify that the apt repositories are configured correctly
supports: supports:
- os-name: debian
- os-name: ubuntu
- platform-name: debian
- platform-name: ubuntu

Loading…
Cancel
Save