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:
parent
9dde8f2b46
commit
545e81714b
5 changed files with 7 additions and 6 deletions
1
Makefile
1
Makefile
|
@ -65,6 +65,7 @@ DOCKER_ENVS := \
|
||||||
-e DOCKER_TEST_HOST \
|
-e DOCKER_TEST_HOST \
|
||||||
-e DOCKER_USERLANDPROXY \
|
-e DOCKER_USERLANDPROXY \
|
||||||
-e DOCKERD_ARGS \
|
-e DOCKERD_ARGS \
|
||||||
|
-e TEST_FORCE_VALIDATE \
|
||||||
-e TEST_INTEGRATION_DIR \
|
-e TEST_INTEGRATION_DIR \
|
||||||
-e TEST_SKIP_INTEGRATION \
|
-e TEST_SKIP_INTEGRATION \
|
||||||
-e TEST_SKIP_INTEGRATION_CLI \
|
-e TEST_SKIP_INTEGRATION_CLI \
|
||||||
|
|
|
@ -7,7 +7,7 @@ IFS=$'\n'
|
||||||
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'profiles/seccomp' || true) )
|
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'profiles/seccomp' || true) )
|
||||||
unset IFS
|
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
|
# We run 'go generate' and see if we have a diff afterwards
|
||||||
go generate ./profiles/seccomp/ >/dev/null
|
go generate ./profiles/seccomp/ >/dev/null
|
||||||
# Let see if the working directory is clean
|
# Let see if the working directory is clean
|
||||||
|
|
|
@ -7,7 +7,7 @@ IFS=$'\n'
|
||||||
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/swagger.yaml' || true) )
|
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/swagger.yaml' || true) )
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
if [ ${#files[@]} -gt 0 ]; then
|
if [ -n "${TEST_FORCE_VALIDATE:-}" ] || [ ${#files[@]} -gt 0 ]; then
|
||||||
LANG=C.UTF-8 yamllint -c ${SCRIPTDIR}/.swagger-yamllint api/swagger.yaml
|
LANG=C.UTF-8 yamllint -c "${SCRIPTDIR}"/.swagger-yamllint api/swagger.yaml
|
||||||
swagger validate api/swagger.yaml
|
swagger validate api/swagger.yaml
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,8 +7,8 @@ IFS=$'\n'
|
||||||
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/types/' 'api/swagger.yaml' || true) )
|
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'api/types/' 'api/swagger.yaml' || true) )
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
if [ ${#files[@]} -gt 0 ]; then
|
if [ -n "${TEST_FORCE_VALIDATE:-}" ] || [ ${#files[@]} -gt 0 ]; then
|
||||||
${SCRIPTDIR}/../generate-swagger-api.sh 2> /dev/null
|
"${SCRIPTDIR}"/../generate-swagger-api.sh 2> /dev/null
|
||||||
# Let see if the working directory is clean
|
# Let see if the working directory is clean
|
||||||
diffs="$(git diff -- api/types/)"
|
diffs="$(git diff -- api/types/)"
|
||||||
if [ "$diffs" ]; then
|
if [ "$diffs" ]; then
|
||||||
|
|
|
@ -8,7 +8,7 @@ validate_vendor_diff(){
|
||||||
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'vendor.conf' 'vendor/' || true) )
|
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'vendor.conf' 'vendor/' || true) )
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
if [ ${#files[@]} -gt 0 ]; then
|
if [ -n "${TEST_FORCE_VALIDATE:-}" ] || [ ${#files[@]} -gt 0 ]; then
|
||||||
# recreate vendor/
|
# recreate vendor/
|
||||||
vndr
|
vndr
|
||||||
# check if any files have changed
|
# check if any files have changed
|
||||||
|
|
Loading…
Reference in a new issue