-
Notifications
You must be signed in to change notification settings - Fork 2
/
test-static.yml
27 lines (25 loc) · 968 Bytes
/
test-static.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
# yamllint disable rule:line-length
test-yaml:
stage: test-static
image: registry.opensuse.org/home/okurz/container/containers/tumbleweed:yamllint
script:
# Check plain yaml files
- >-
if command -v git >/dev/null; then \
git ls-files -z "*.yml" "*.yaml"; else \
find \( -name "*.yml" -or -name "*.yaml" \) -print0; fi | \
xargs -tr0 yamllint
# Check sls files without jinja delimiters
- >-
if command -v git >/dev/null; then \
git ls-files -z "*.sls" | xargs -0r -- grep -LZF -e '{{' -e '{%' -e '{#'; else \
find -name '*.sls' ! -exec grep -qF -e '{{' -e '{%' -e '{#' {} \; -print0; fi | \
xargs -tr0 yamllint
test-salt-lint:
stage: test-static
image:
name: registry.opensuse.org/home/okurz/container/containers/tumbleweed:salt-lint
entrypoint: [""]
script:
- salt-lint -v $(if command -v git >/dev/null; then git ls-files "*.sls"; else find -name '*.sls'; fi)