File tree Expand file tree Collapse file tree 9 files changed +119
-19
lines changed Expand file tree Collapse file tree 9 files changed +119
-19
lines changed Original file line number Diff line number Diff line change 3
3
---
4
4
stages :
5
5
- test
6
- - commitlint
6
+ - lint
7
7
- name : release
8
8
if : branch = master AND type != pull_request
9
9
50
50
# - INSTANCE: default-amazonlinux-2-2018-3-py2
51
51
# - INSTANCE: default-debian-8-2017-7-py2
52
52
# - INSTANCE: default-ubuntu-1604-2017-7-py2
53
- - INSTANCE : default -centos-6-2017-7-py2
53
+ - INSTANCE : centos6 -centos-6-2017-7-py2
54
54
# - INSTANCE: default-fedora-29-2017-7-py2
55
55
# - INSTANCE: default-opensuse-leap-15-2017-7-py2
56
56
# - INSTANCE: default-amazonlinux-2-2017-7-py2
@@ -60,16 +60,21 @@ script:
60
60
61
61
jobs :
62
62
include :
63
- # Define the commitlint stage
64
- - stage : commitlint
63
+ # Define the `lint` stage (runs `yamllint` and `commitlint`)
64
+ - stage : lint
65
65
language : node_js
66
66
node_js : lts/*
67
67
before_install : skip
68
68
script :
69
+ # Install and run `yamllint`
70
+ - pip install --user yamllint
71
+ # yamllint disable-line rule:line-length
72
+ - yamllint -s . .yamllint pillar.example test/salt/pillar/define_roles.sls test/salt/pillar/centos6.sls
73
+ # Install and run `commitlint`
69
74
- npm install @commitlint/config-conventional -D
70
75
- npm install @commitlint/travis-cli -D
71
76
- commitlint-travis
72
- # Define the release stage that runs semantic-release
77
+ # Define the release stage that runs ` semantic-release`
73
78
- stage : release
74
79
language : node_js
75
80
node_js : lts/*
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
4
+ # Extend the `default` configuration provided by `yamllint`
5
+ extends : default
6
+
7
+ # Files to ignore completely
8
+ # 1. All YAML files under directory `node_modules/`, introduced during the Travis run
9
+ ignore : |
10
+ node_modules/
11
+
12
+ rules :
13
+ line-length :
14
+ # Increase from default of `80`
15
+ # Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
16
+ max : 88
Original file line number Diff line number Diff line change @@ -134,6 +134,8 @@ verifier:
134
134
135
135
suites :
136
136
- name : default
137
+ excludes :
138
+ - centos-6-2017-7-py2
137
139
provisioner :
138
140
state_top :
139
141
base :
@@ -144,8 +146,30 @@ suites:
144
146
base :
145
147
' * ' :
146
148
- template
149
+ - define_roles
147
150
pillars_from_files :
148
151
template.sls : pillar.example
152
+ define_roles.sls : test/salt/pillar/define_roles.sls
153
+ verifier :
154
+ inspec_tests :
155
+ - path : test/integration/default
156
+ - name : centos6
157
+ includes :
158
+ - centos-6-2017-7-py2
159
+ provisioner :
160
+ state_top :
161
+ base :
162
+ ' * ' :
163
+ - template
164
+ pillars :
165
+ top.sls :
166
+ base :
167
+ ' * ' :
168
+ - template
169
+ - define_roles
170
+ pillars_from_files :
171
+ template.sls : test/salt/pillar/centos6.sls
172
+ define_roles.sls : test/salt/pillar/define_roles.sls
149
173
verifier :
150
174
inspec_tests :
151
175
- path : test/integration/default
Original file line number Diff line number Diff line change @@ -11,17 +11,10 @@ template:
11
11
# Using bash package and udev service as an example. This allows us to
12
12
# test the template formula itself. You should set these parameters to
13
13
# examples that make sense in the contexto of the formula you're writing.
14
- {%- if grains.osfinger == 'CentOS-6' %}
15
- pkg :
16
- name : cronie
17
- service :
18
- name : crond
19
- {%- else %}
20
14
pkg :
21
15
name : bash
22
16
service :
23
17
name : systemd-udevd
24
- {%- endif %}
25
18
config : /etc/template-formula.conf
26
19
27
20
tofs :
Original file line number Diff line number Diff line change 48
48
49
49
{#- Change **template** to match with your formula's name and then remove this line #}
50
50
{% - set template = config %}
51
+
52
+ {#- Post-processing for specific non-YAML customisations #}
53
+ {% - if grains .os == 'MacOS' %}
54
+ {% - set macos_group = salt ['cmd.run' ]("stat -f '%Sg' /dev/console" ) %}
55
+ {% - do template .update ({'rootgroup' : macos_group }) %}
56
+ {% - endif %}
Original file line number Diff line number Diff line change 1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8 -*-
2
2
# vim: ft=yaml
3
3
#
4
4
# Setup variables using grains['os_family'] based logic.
10
10
# you will need to provide at least an empty dict in this file, e.g.
11
11
# osfamilymap: {}
12
12
---
13
- {%- if grains.os == 'MacOS' %}
14
- {%- set macos_rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
15
- {%- endif %}
16
-
17
13
Debian :
18
14
pkg :
19
15
name : template-debian
@@ -48,5 +44,4 @@ Solaris: {}
48
44
49
45
Windows : {}
50
46
51
- MacOS :
52
- rootgroup : {{ macos_rootgroup | d('') }}
47
+ MacOS : {}
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
1
4
name : default
2
5
title : template formula
3
6
maintainer : SaltStack Formulas
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
4
+ template :
5
+ lookup :
6
+ master : template-master
7
+ # Just for testing purposes
8
+ winner : lookup
9
+ added_in_lookup : lookup_value
10
+
11
+ # Using bash package and udev service as an example. This allows us to
12
+ # test the template formula itself. You should set these parameters to
13
+ # examples that make sense in the contexto of the formula you're writing.
14
+ pkg :
15
+ name : cronie
16
+ service :
17
+ name : crond
18
+ config : /etc/template-formula.conf
19
+
20
+ tofs :
21
+ # The files_switch key serves as a selector for alternative
22
+ # directories under the formula files directory. See TOFS pattern
23
+ # doc for more info.
24
+ # Note: Any value not evaluated by `config.get` will be used literally.
25
+ # This can be used to set custom paths, as many levels deep as required.
26
+ files_switch :
27
+ - any/path/can/be/used/here
28
+ - id
29
+ - roles
30
+ - osfinger
31
+ - os
32
+ - os_family
33
+ # All aspects of path/file resolution are customisable using the options below.
34
+ # This is unnecessary in most cases; there are sensible defaults.
35
+ # path_prefix: template_alt
36
+ # dirs:
37
+ # files: files_alt
38
+ # default: default_alt
39
+ # The entries under `source_files` are prepended to the default source files
40
+ # given for the state
41
+ # source_files:
42
+ # template-config-file-file-managed:
43
+ # - 'example_alt.tmpl'
44
+ # - 'example_alt.tmpl.jinja'
45
+
46
+ # For testing purposes
47
+ source_files :
48
+ template-config-file-file-managed :
49
+ - ' example.tmpl.jinja'
50
+ template-subcomponent-config-file-file-managed :
51
+ - ' subcomponent-example.tmpl.jinja'
52
+
53
+ # Just for testing purposes
54
+ winner : pillar
55
+ added_in_pillar : pillar_value
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ # vim: ft=yaml
3
+ ---
1
4
# libtofs.jinja must work with tofs.files_switch looked up list
2
5
roles :
3
6
- foo
You can’t perform that action at this time.
0 commit comments