Skip to content

Commit

Permalink
Support Linting YAML as part of Travis CI build (#554)
Browse files Browse the repository at this point in the history
* add yamllint command to travis CI

installs and runs a linter across the YAML in the
project to ensure consistency in the written YAML.

this uses yamllint and the default yamllint config with
"truthy" and "line-length" disabled.

* run dos2unix on CRLF files

* YAMLLINT: remove trailing spaces

* YAMLLint: add YAML document start

* YAMLLint: too many spaces around bracket

* YAMLLint: fix indentation

* YAMLLint: remove duplicate key

* YAMLLint: newline at end of file

* YAMLLint: Too few spaces after comma

* YAMLLint: too many spaces after colon
  • Loading branch information
imnotjames authored and lizrice committed Jan 6, 2020
1 parent dc14cb1 commit 5f34058
Show file tree
Hide file tree
Showing 28 changed files with 8,076 additions and 8,062 deletions.
5 changes: 3 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
env:
- GO111MODULE=on
- KUBEBENCH_CFG=/etc/kube-bench/cfg
Expand All @@ -9,8 +10,8 @@ builds:
goarch:
- amd64
ldflags:
- "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion={{.Version}}"
- "-X github.com/aquasecurity/kube-bench/cmd.cfgDir={{.Env.KUBEBENCH_CFG}}"
- "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion={{.Version}}"
- "-X github.com/aquasecurity/kube-bench/cmd.cfgDir={{.Env.KUBEBENCH_CFG}}"
# Archive customization
archive:
format: tar.gz
Expand Down
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@
language: go

services:
- docker
- docker

notifications:
email: false

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y rpm
- pip install --user yamllint==1.18.0
- gem install --no-ri --no-rdoc fpm
- go get -t -v ./...

script:
- yamllint -c ./.yamllint.yaml .
- GO111MODULE=on go test ./...
- IMAGE_NAME=kube-bench make build-docker
- docker run -v `pwd`:/host kube-bench install
- docker run -v `pwd`:/host kube-bench install
- test -d cfg
- test -f kube-bench
- make tests
- make integration-tests

after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
Expand Down
6 changes: 6 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
extends: default

rules:
line-length: disable
truthy: disable
2 changes: 1 addition & 1 deletion cfg/cis-1.3/config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
## Version-specific settings that override the values in cfg/config.yaml
## Version-specific settings that override the values in cfg/config.yaml
Loading

0 comments on commit 5f34058

Please sign in to comment.