Skip to content

Commit d6a46c2

Browse files
Merge pull request #47 from myii/ci/standardise-structure
chore: use `semantic-release` cross-formula standard structure
2 parents 774c8ff + 5879b84 commit d6a46c2

File tree

8 files changed

+134
-29
lines changed

8 files changed

+134
-29
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ coverage.xml
4848
.kitchen
4949
.kitchen.local.yml
5050
kitchen.local.yml
51+
junit-*.xml
5152

5253
# Translations
5354
*.mo
@@ -111,3 +112,11 @@ docs/*.md
111112

112113
# Vim
113114
*.sw?
115+
116+
## Collected when centralising formulas (check and sort)
117+
# `collectd-formula`
118+
.pytest_cache/
119+
/.idea/
120+
Dockerfile.*_*
121+
ignore/
122+
tmp/

.travis.yml

+5-15
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,26 @@ stages:
77
sudo: required
88
cache: bundler
99
language: ruby
10+
dist: xenial
1011

1112
services:
1213
- docker
1314

1415
# Make sure the instances listed below match up with
1516
# the `platforms` defined in `kitchen.yml`
16-
# NOTE: Please try to select up to six instances that add some meaningful
17-
# testing of the formula's behaviour. If possible, try to refrain from
18-
# the classical "chosing all the instances because I want to test on
19-
# another/all distro/s" trap: it will just add time to the testing (see
20-
# the discussion on #121). As an example, the set chosen below covers
21-
# the most used distros families, systemd and non-systemd and the latest
22-
# three supported Saltstack versions with python2 and 3."
23-
# As for `kitchen.yml`, that should still contain all of the platforms,
24-
# to allow for comprehensive local testing
25-
# Ref: https://github.com/saltstack-formulas/template-formula/issues/118
26-
# Ref: https://github.com/saltstack-formulas/template-formula/issues/121
2717
env:
2818
matrix:
2919
- INSTANCE: repositories-debian-9-develop-py3
30-
# - INSTANCE: repositories-ubuntu-1804-develop-py3
31-
- INSTANCE: repositories-debian-9-2019-2-py3
32-
- INSTANCE: repositories-ubuntu-1804-2019-2-py3
3320
- INSTANCE: preferences-debian-9-develop-py3
21+
# - INSTANCE: repositories-ubuntu-1804-develop-py3
3422
# - INSTANCE: preferences-ubuntu-1804-develop-py3
23+
- INSTANCE: repositories-debian-9-2019-2-py3
3524
- INSTANCE: preferences-debian-9-2019-2-py3
25+
- INSTANCE: repositories-ubuntu-1804-2019-2-py3
3626
- INSTANCE: preferences-ubuntu-1804-2019-2-py3
3727

3828
script:
39-
- bundle exec kitchen verify ${INSTANCE}
29+
- bin/kitchen verify ${INSTANCE}
4030

4131
jobs:
4232
include:

docs/CONTRIBUTING.rst

+1
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,4 @@ An example of that:
156156
BREAKING CHANGE: With the removal of all of the `.sls` files under
157157
`template package`, this formula no longer supports the installation of
158158
packages.
159+

kitchen.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ platforms:
2525
- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
2626
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
2727

28-
## SALT 2019.2
28+
## SALT `2019.2`
2929
- name: debian-9-2019-2-py3
3030
driver:
3131
image: netmanagers/salt-2019.2-py3:debian-9
@@ -42,11 +42,6 @@ provisioner:
4242
salt_copy_filter:
4343
- .kitchen
4444
- .git
45-
pillars:
46-
top.sls:
47-
base:
48-
'*':
49-
- apt
5045

5146
verifier:
5247
# https://www.inspec.io/
@@ -64,6 +59,11 @@ suites:
6459
'*':
6560
- apt.repositories
6661
- apt.update
62+
pillars:
63+
top.sls:
64+
base:
65+
'*':
66+
- apt
6767
pillars_from_files:
6868
apt.sls: test/salt/pillar/repositories.pillar.sls
6969
verifier:
@@ -75,6 +75,11 @@ suites:
7575
base:
7676
'*':
7777
- apt.preferences
78+
pillars:
79+
top.sls:
80+
base:
81+
'*':
82+
- apt
7883
pillars_from_files:
7984
apt.sls: test/salt/pillar/preferences.pillar.sls
8085
verifier:
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# InSpec Profile: `preferences`
2+
3+
This shows the implementation of the `preferences` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4+
5+
## Verify a profile
6+
7+
InSpec ships with built-in features to verify a profile structure.
8+
9+
```bash
10+
$ inspec check preferences
11+
Summary
12+
-------
13+
Location: preferences
14+
Profile: profile
15+
Controls: 4
16+
Timestamp: 2019-06-24T23:09:01+00:00
17+
Valid: true
18+
19+
Errors
20+
------
21+
22+
Warnings
23+
--------
24+
```
25+
26+
## Execute a profile
27+
28+
To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29+
30+
```bash
31+
$ inspec exec preferences
32+
..
33+
34+
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35+
8 examples, 0 failures
36+
```
37+
38+
## Execute a specific control from a profile
39+
40+
To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41+
42+
```bash
43+
$ inspec exec preferences --controls package
44+
.
45+
46+
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47+
1 examples, 0 failures
48+
```
49+
50+
See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: preferences
2-
title: Apt Formula
3-
maintainer: Saltstack-formulas org
2+
title: apt formula
3+
maintainer: SaltStack Formulas
44
license: Apache-2.0
55
summary: Verify that the apt preferences are configured correctly
66
supports:
7-
- os-name: debian
8-
- os-name: ubuntu
7+
- platform-name: debian
8+
- platform-name: ubuntu
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# InSpec Profile: `repositories`
2+
3+
This shows the implementation of the `repositories` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4+
5+
## Verify a profile
6+
7+
InSpec ships with built-in features to verify a profile structure.
8+
9+
```bash
10+
$ inspec check repositories
11+
Summary
12+
-------
13+
Location: repositories
14+
Profile: profile
15+
Controls: 4
16+
Timestamp: 2019-06-24T23:09:01+00:00
17+
Valid: true
18+
19+
Errors
20+
------
21+
22+
Warnings
23+
--------
24+
```
25+
26+
## Execute a profile
27+
28+
To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29+
30+
```bash
31+
$ inspec exec repositories
32+
..
33+
34+
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35+
8 examples, 0 failures
36+
```
37+
38+
## Execute a specific control from a profile
39+
40+
To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41+
42+
```bash
43+
$ inspec exec repositories --controls package
44+
.
45+
46+
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47+
1 examples, 0 failures
48+
```
49+
50+
See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: repositories
2-
title: Apt Formula
3-
maintainer: Saltstack-formulas org
2+
title: apt formula
3+
maintainer: SaltStack Formulas
44
license: Apache-2.0
55
summary: Verify that the apt repositories are configured correctly
66
supports:
7-
- os-name: debian
8-
- os-name: ubuntu
7+
- platform-name: debian
8+
- platform-name: ubuntu

0 commit comments

Comments
 (0)