1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 15:47:14 +01:00

Prow: Add shellcheck to openshift/installer

This commit is contained in:
Alejandro Rosero V
2018-08-02 15:29:12 -05:00
parent ee5e296905
commit fcaf88317c
2 changed files with 8 additions and 6 deletions

View File

@@ -20,12 +20,7 @@ jobs:
'{extends: default, rules: {line-length: {level: warning, max: 120}}}'
./examples/ ./installer/
name: YAML lint
- script: >
docker run -v $(pwd):/workdir:ro
--entrypoint sh quay.io/coreos/shellcheck-alpine:v0.5.0
-c 'for file in $(find /workdir/ -type f -name "*.sh"); do
if ! shellcheck --format=gcc $file; then export FAILED=true; fi; done;
if [ "$FAILED" != "" ]; then exit 1; fi'
- script: ./hack/shellcheck.sh
name: shellcheck
- script: "docker run -v $PWD:/go/src/github.com/openshift/installer -w /go/src/github.com/openshift/installer quay.io/coreos/golang-testing go vet ./installer/..."
name: Go vet

7
hack/shellcheck.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
DIR="${1:-.}"
if [ "$IS_CONTAINER" != "" ]; then
find "${DIR}" -type f -name '*.sh' -exec shellcheck --format=gcc {} \+
else
docker run -e IS_CONTAINER='TRUE' --rm -v "$(realpath "${DIR}")":/workdir:ro --entrypoint sh quay.io/coreos/shellcheck-alpine:v0.5.0 /workdir/hack/shellcheck.sh /workdir;
fi;