1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

hack/validate: allow forcing validation

This introduces a FORCE_VALIDATE environment variable, which allows
forcing some validation steps, even if no changes were detected.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-10-07 15:20:03 +02:00
parent 9dde8f2b46
commit 545e81714b
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
5 changed files with 7 additions and 6 deletions

View file

@ -65,6 +65,7 @@ DOCKER_ENVS := \
-e DOCKER_TEST_HOST \
-e DOCKER_USERLANDPROXY \
-e DOCKERD_ARGS \
-e TEST_FORCE_VALIDATE \
-e TEST_INTEGRATION_DIR \
-e TEST_SKIP_INTEGRATION \
-e TEST_SKIP_INTEGRATION_CLI \

View file

@ -7,7 +7,7 @@ IFS=$'\n'
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'profiles/seccomp' || true) )
unset IFS
if [ ${#files[@]} -gt 0 ]; then
if [ -n "${TEST_FORCE_VALIDATE:-}" ] || [ ${#files[@]} -gt 0 ]; then
# We run 'go generate' and see if we have a diff afterwards
go generate ./profiles/seccomp/ >/dev/null
# Let see if the working directory is clean

View file

@ -7,7 +7,7 @@ IFS=$'\n'
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/swagger.yaml' || true) )
unset IFS
if [ ${#files[@]} -gt 0 ]; then
LANG=C.UTF-8 yamllint -c ${SCRIPTDIR}/.swagger-yamllint api/swagger.yaml
if [ -n "${TEST_FORCE_VALIDATE:-}" ] || [ ${#files[@]} -gt 0 ]; then
LANG=C.UTF-8 yamllint -c "${SCRIPTDIR}"/.swagger-yamllint api/swagger.yaml
swagger validate api/swagger.yaml
fi

View file

@ -7,8 +7,8 @@ IFS=$'\n'
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/types/' 'api/swagger.yaml' || true) )
unset IFS
if [ ${#files[@]} -gt 0 ]; then
${SCRIPTDIR}/../generate-swagger-api.sh 2> /dev/null
if [ -n "${TEST_FORCE_VALIDATE:-}" ] || [ ${#files[@]} -gt 0 ]; then
"${SCRIPTDIR}"/../generate-swagger-api.sh 2> /dev/null
# Let see if the working directory is clean
diffs="$(git diff -- api/types/)"
if [ "$diffs" ]; then

View file

@ -8,7 +8,7 @@ validate_vendor_diff(){
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'vendor.conf' 'vendor/' || true) )
unset IFS
if [ ${#files[@]} -gt 0 ]; then
if [ -n "${TEST_FORCE_VALIDATE:-}" ] || [ ${#files[@]} -gt 0 ]; then
# recreate vendor/
vndr
# check if any files have changed