Skip to content

hack: Add :z to --volume mounts #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions hack/go-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
if [ "$IS_CONTAINER" != "" ]; then
golint -set_exit_status "${@}"
else
docker run --rm --env IS_CONTAINER='TRUE' \
-v "$PWD":/go/src/github.com/openshift/installer \
-w /go/src/github.com/openshift/installer \
--entrypoint sh quay.io/coreos/golang-testing \
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/go/src/github.com/openshift/installer:z" \
--workdir /go/src/github.com/openshift/installer \
--entrypoint sh \
quay.io/coreos/golang-testing \
./hack/go-lint.sh "${@}"
fi
7 changes: 6 additions & 1 deletion hack/go-vet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
if [ "$IS_CONTAINER" != "" ]; then
go vet "${@}"
else
docker run --rm --env IS_CONTAINER='TRUE' -v "$PWD":/go/src/github.com/openshift/installer -w /go/src/github.com/openshift/installer quay.io/coreos/golang-testing ./hack/go-vet.sh "${@}"
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/go/src/github.com/openshift/installer:z" \
--workdir /go/src/github.com/openshift/installer \
quay.io/coreos/golang-testing \
./hack/go-vet.sh "${@}"
fi;
7 changes: 6 additions & 1 deletion hack/shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ if [ "$IS_CONTAINER" != "" ]; then
-o -path "${TOP_DIR}/.build" -prune \
-o -type f -name '*.sh' -exec shellcheck --format=gcc {} \+
else
docker run -e IS_CONTAINER='TRUE' --rm -v "$(pwd)":/workdir:ro --entrypoint sh quay.io/coreos/shellcheck-alpine:v0.5.0 /workdir/hack/shellcheck.sh /workdir;
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/workdir:ro,z" \
--entrypoint sh \
quay.io/coreos/shellcheck-alpine:v0.5.0 \
/workdir/hack/shellcheck.sh /workdir
fi;
7 changes: 6 additions & 1 deletion hack/test-bazel-build-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ if [ "$IS_CONTAINER" != "" ]; then
set -x
bazel --output_base=/tmp build "$@" tarball
else
docker run -e IS_CONTAINER='TRUE' --rm -v "$PWD":"$PWD" -v /tmp:/tmp:rw -w "$PWD" quay.io/coreos/tectonic-builder:bazel-v0.3 ./hack/test-bazel-build-tarball.sh
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:${PWD}:z" \
--workdir "${PWD}" \
quay.io/coreos/tectonic-builder:bazel-v0.3 \
./hack/test-bazel-build-tarball.sh
fi
7 changes: 6 additions & 1 deletion hack/tf-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ if [ "$IS_CONTAINER" != "" ]; then
set -x
/terraform fmt -list -check -write=false
else
docker run -e IS_CONTAINER='TRUE' --rm -v "$PWD":"$PWD":ro -v /tmp:/tmp:rw -w "$PWD" quay.io/coreos/terraform-alpine:v0.11.7 ./hack/tf-fmt.sh
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:${PWD}:ro,z" \
--workdir "${PWD}" \
quay.io/coreos/terraform-alpine:v0.11.7 \
./hack/tf-fmt.sh
fi
7 changes: 6 additions & 1 deletion hack/tf-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
if [ "$IS_CONTAINER" != "" ]; then
tflint
else
docker run -t --rm -v "$(pwd)":/data --env IS_CONTAINER='TRUE' --entrypoint sh quay.io/coreos/tflint ./hack/tf-lint.sh
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/data:z" \
--entrypoint sh \
quay.io/coreos/tflint \
./hack/tf-lint.sh
fi;
7 changes: 6 additions & 1 deletion hack/yaml-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
if [ "$IS_CONTAINER" != "" ]; then
yamllint --config-data "{extends: default, rules: {line-length: {level: warning, max: 120}}}" ./examples/ ./installer/
else
docker run -t --rm -v "$(pwd)":/workdir --env IS_CONTAINER='TRUE' --entrypoint sh quay.io/coreos/yamllint ./hack/yaml-lint.sh
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/workdir:z" \
--entrypoint sh \
quay.io/coreos/yamllint \
./hack/yaml-lint.sh
fi;