Skip to content

Commit

Permalink
Merge pull request #153 from myii/chore/standardise-structure
Browse files Browse the repository at this point in the history
chore: use `semantic-release` cross-formula standard structure
  • Loading branch information
myii authored Jul 30, 2019
2 parents 10e23bc + 4a71611 commit 9b98b3e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 35 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ coverage.xml
.kitchen
.kitchen.local.yml
kitchen.local.yml
junit-*.xml

# Translations
*.mo
Expand Down Expand Up @@ -111,3 +112,11 @@ docs/*.md

# Vim
*.sw?

## Collected when centralising formulas (check and sort)
# `collectd-formula`
.pytest_cache/
/.idea/
Dockerfile.*_*
ignore/
tmp/
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
stages:
- test
- commitlint
Expand All @@ -7,6 +10,7 @@ stages:
sudo: required
cache: bundler
language: ruby
dist: xenial

services:
- docker
Expand All @@ -19,7 +23,7 @@ services:
# 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."
# 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
Expand All @@ -40,19 +44,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-fedora-28-2017-7-py2
# - INSTANCE: default-opensuse-leap-42-2017-7-py2

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

jobs:
include:
Expand Down
43 changes: 18 additions & 25 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ platforms:
- sh bootstrap-salt.sh -XdPbfrq -x python3 git develop
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
Expand All @@ -62,7 +62,7 @@ platforms:
image: netmanagers/salt-2019.2-py3:opensuse-leap-15
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
Expand All @@ -75,25 +75,18 @@ 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
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
Expand All @@ -115,19 +108,6 @@ provisioner:
salt_copy_filter:
- .kitchen
- .git
state_top:
base:
'*':
- template
pillars:
top.sls:
base:
'*':
- template
- define_roles
pillars_from_files:
template.sls: pillar.example
define_roles.sls: test/salt/pillar/define_roles.sls

verifier:
# https://www.inspec.io/
Expand All @@ -136,8 +116,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:
'*':
- template
pillars:
top.sls:
base:
'*':
- template
pillars_from_files:
template.sls: pillar.example
verifier:
inspec_tests:
- path: test/integration/default
4 changes: 2 additions & 2 deletions test/integration/default/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 4 additions & 2 deletions test/integration/default/inspec.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: template
name: default
title: template formula
maintainer: Your Name
maintainer: SaltStack Formulas
license: Apache-2.0
summary: Verify that the template formula is setup and configured correctly
supports:
Expand All @@ -10,3 +10,5 @@ supports:
- platform-name: fedora
- platform-name: opensuse
- platform-name: suse
- platform-name: freebsd
- platform-name: amazon

0 comments on commit 9b98b3e

Please sign in to comment.