Skip to content

Commit

Permalink
ci(lint): test
Browse files Browse the repository at this point in the history
  • Loading branch information
dafyddj committed Oct 21, 2019
1 parent c24e1cc commit 1037162
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .salt/minion
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
root_dir: /home/travis/.salt
file_client: local
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ jobs:
script:
# Install and run `salt-lint`
- pip install --user salt-lint
- git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$'
| xargs -I {} salt-lint {}
- git ls-files '*.sls' '*.jinja' '*.j2*' '*.tmpl' | xargs salt-lint
# Render .sls files before running `yamllint` on them
# Create parallel directory tree of empty dirs as get_template doesn't create directories
- git ls-files '*.sls' |
xargs -I {} bash -c 'mkdir -p $(pwd)/.rendered/${1%/*}' -- {}
# yamllint disable rule:line-length
- git ls-files '*.sls' |
xargs -I {} sh -c 'salt-call -c $(pwd)/.salt --file-root=$(pwd) cp.get_template $(pwd)/$1 $(pwd)/.rendered/${1%.*}.yaml' -- {}
# yamllint enable rule:line-length
- ls -R .rendered
# Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0
Expand Down

0 comments on commit 1037162

Please sign in to comment.