From 94a9d2af44af2efc948a540a28cdb386d4c27908 Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Sun, 22 Jan 2023 12:15:12 +1300 Subject: [PATCH] added `ALWAYS_RUN` target `Makefile` recipies (#3013) This ensures the recipies are always run. Co-authored-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com> --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 584ee997..5fc222ff 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ BATS_PARALLEL_JOBS ?= 2 all: lint build generate-accounts tests clean -build: +build: ALWAYS_RUN @ DOCKER_BUILDKIT=1 docker build \ --tag $(IMAGE_NAME) \ --build-arg VCS_VERSION=$(shell git rev-parse --short HEAD) \ @@ -30,7 +30,7 @@ generate-accounts: ALWAYS_RUN # `docker ps`: Remove any lingering test containers # `.gitignore`: Remove `test/duplicate_configs` and files copied via `make generate-accounts` -clean: +clean: ALWAYS_RUN -@ for CONTAINER in $$(docker ps -a --filter name='^dms-test_.*|^mail_.*|^hadolint$$|^eclint$$|^shellcheck$$' | sed 1d | cut -f 1-1 -d ' '); do docker rm -f $${CONTAINER}; done -@ while read -r LINE; do [[ $${LINE} =~ test/.+ ]] && sudo rm -rf $${LINE}; done < .gitignore @@ -47,7 +47,7 @@ tests/serial: ALWAYS_RUN @ shopt -s globstar ; ./test/bats/bin/bats $(BATS_FLAGS) test/$@/*.bats tests/parallel/set%: ALWAYS_RUN - @ shopt -s globstar ; ./test/bats/bin/bats $(BATS_FLAGS) \ + @ shopt -s globstar ; $(REPOSITORY_ROOT)/test/bats/bin/bats $(BATS_FLAGS) \ --no-parallelize-within-files \ --jobs $(BATS_PARALLEL_JOBS) \ test/$@/**/*.bats @@ -59,13 +59,13 @@ test/%: ALWAYS_RUN # --- Lints ------------------------------------- # ----------------------------------------------- -lint: eclint hadolint shellcheck +lint: ALWAYS_RUN eclint hadolint shellcheck -hadolint: +hadolint: ALWAYS_RUN @ ./test/linting/lint.sh hadolint -shellcheck: +shellcheck: ALWAYS_RUN @ ./test/linting/lint.sh shellcheck -eclint: +eclint: ALWAYS_RUN @ ./test/linting/lint.sh eclint