Skip to content

Commit 250fb9d

Browse files
committed
chore: use semantic-release cross-formula standard structure
* Automated using `ssf-formula` (v0.1.0-rc.1)
1 parent 99abfa3 commit 250fb9d

12 files changed

Lines changed: 251 additions & 15 deletions

File tree

.gitignore

Lines changed: 12 additions & 0 deletions
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
@@ -108,3 +109,14 @@ Gemfile.lock
108109

109110
# copied `.md` files used for conversion to `.rst` using `m2r`
110111
docs/*.md
112+
113+
# Vim
114+
*.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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
stages:
25
- test
36
- commitlint
@@ -30,19 +33,15 @@ env:
3033
# - INSTANCE: ubuntu-1604-2018-3-py2
3134
# - INSTANCE: centos-7-2018-3-py2
3235
- INSTANCE: fedora-29-2018-3-py2
33-
# TODO: Use this when fixed instead of `opensuse-leap-42`
34-
# Ref: https://github.com/netmanagers/salt-image-builder/issues/2
35-
# - INSTANCE: opensuse-leap-15-2018-3-py2
3636
- INSTANCE: opensuse-leap-42-2018-3-py2
3737
- INSTANCE: debian-8-2017-7-py2
3838
# - INSTANCE: ubuntu-1604-2017-7-py2
39-
# TODO: Enable after improving the formula to work with other than `systemd`
4039
# - INSTANCE: centos-6-2017-7-py2
4140
# - INSTANCE: fedora-29-2017-7-py2
4241
# - INSTANCE: opensuse-leap-15-2017-7-py2
4342

4443
script:
45-
- bundle exec kitchen test ${INSTANCE}
44+
- bin/kitchen test ${INSTANCE}
4645

4746
jobs:
4847
include:

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ source "https://rubygems.org"
33
gem 'kitchen-docker', '>= 2.9'
44
gem 'kitchen-salt', '>= 0.6.0'
55
gem 'kitchen-inspec', '>= 1.1'
6+

bin/kitchen

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
#
5+
# This file was generated by Bundler.
6+
#
7+
# The application 'kitchen' is installed as part of a gem, and
8+
# this file is here to facilitate running it.
9+
#
10+
11+
require "pathname"
12+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13+
Pathname.new(__FILE__).realpath)
14+
15+
bundle_binstub = File.expand_path("../bundle", __FILE__)
16+
17+
if File.file?(bundle_binstub)
18+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
19+
load(bundle_binstub)
20+
else
21+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
22+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
23+
end
24+
end
25+
26+
require "rubygems"
27+
require "bundler/setup"
28+
29+
load Gem.bin_path("test-kitchen", "kitchen")

docs/CONTRIBUTING.rst

Lines changed: 1 addition & 0 deletions
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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ platforms:
5252
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
5353
run_command: /usr/lib/systemd/systemd
5454

55-
## SALT 2019.2
55+
## SALT `2019.2`
5656
- name: debian-9-2019-2-py3
5757
driver:
5858
image: netmanagers/salt-2019.2-py3:debian-9
@@ -70,7 +70,7 @@ platforms:
7070
image: netmanagers/salt-2019.2-py3:opensuse-leap-15
7171
run_command: /usr/lib/systemd/systemd
7272

73-
## SALT 2018.3
73+
## SALT `2018.3`
7474
- name: debian-9-2018-3-py2
7575
driver:
7676
image: netmanagers/salt-2018.3-py2:debian-9
@@ -83,25 +83,18 @@ platforms:
8383
- name: fedora-29-2018-3-py2
8484
driver:
8585
image: netmanagers/salt-2018.3-py2:fedora-29
86-
# TODO: Use this when fixed instead of `opensuse-leap-42`
87-
# Ref: https://github.com/netmanagers/salt-image-builder/issues/2
88-
# - name: opensuse-leap-15-2018-3-py2
89-
# driver:
90-
# image: netmanagers/salt-2018.3-py2:opensuse-leap-15
91-
# run_command: /usr/lib/systemd/systemd
9286
- name: opensuse-leap-42-2018-3-py2
9387
driver:
9488
image: netmanagers/salt-2018.3-py2:opensuse-leap-42
9589
run_command: /usr/lib/systemd/systemd
9690

97-
## SALT 2017.7
91+
## SALT `2017.7`
9892
- name: debian-8-2017-7-py2
9993
driver:
10094
image: netmanagers/salt-2017.7-py2:debian-8
10195
- name: ubuntu-1604-2017-7-py2
10296
driver:
10397
image: netmanagers/salt-2017.7-py2:ubuntu-16.04
104-
# TODO: Modify the formula to work for non-`systemd` platforms
10598
- name: centos-6-2017-7-py2
10699
driver:
107100
image: netmanagers/salt-2017.7-py2:centos-6
@@ -146,6 +139,9 @@ suites:
146139
- vault
147140
pillars_from_files:
148141
vault.sls: test/salt/pillar/install_binary.sls
142+
verifier:
143+
inspec_tests:
144+
- path: test/integration/install_binary
149145
- name: dev_server
150146
provisioner:
151147
state_top:
@@ -159,6 +155,9 @@ suites:
159155
- vault
160156
pillars_from_files:
161157
vault.sls: test/salt/pillar/dev_server.sls
158+
verifier:
159+
inspec_tests:
160+
- path: test/integration/dev_server
162161
- name: prod_server
163162
provisioner:
164163
state_top:
@@ -172,3 +171,6 @@ suites:
172171
- vault
173172
pillars_from_files:
174173
vault.sls: test/salt/pillar/prod_server.sls
174+
verifier:
175+
inspec_tests:
176+
- path: test/integration/prod_server
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# InSpec Profile: `dev_server`
2+
3+
This shows the implementation of the `dev_server` 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 dev_server
11+
Summary
12+
-------
13+
Location: dev_server
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 dev_server
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 dev_server --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).
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: dev_server
2+
title: vault formula
3+
maintainer: SaltStack Formulas
4+
license: Apache-2.0
5+
summary: Verify that the vault development server is setup and configured correctly
6+
supports:
7+
- platform-name: debian
8+
- platform-name: ubuntu
9+
- platform-name: centos
10+
- platform-name: fedora
11+
- platform-name: opensuse
12+
- platform-name: suse
13+
- platform-name: freebsd
14+
- platform-name: amazon
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# InSpec Profile: `install_binary`
2+
3+
This shows the implementation of the `install_binary` 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 install_binary
11+
Summary
12+
-------
13+
Location: install_binary
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 install_binary
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 install_binary --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).
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: install_binary
2+
title: vault formula
3+
maintainer: SaltStack Formulas
4+
license: Apache-2.0
5+
summary: Verify that the vault binary is installed correctly
6+
supports:
7+
- platform-name: debian
8+
- platform-name: ubuntu
9+
- platform-name: centos
10+
- platform-name: fedora
11+
- platform-name: opensuse
12+
- platform-name: suse
13+
- platform-name: freebsd
14+
- platform-name: amazon

0 commit comments

Comments
 (0)