mirror of
https://github.com/docker/docker-install.git
synced 2026-11-20 10:03:11 +03:00
In previous versions of shellcheck, SC2317 was emitted for every line of a unused function and we're ignoring the SC2317 completely: https://github.com/docker/docker-install/blob/6e61729e66af62fd54c0b659751a431be8f90f68/Makefile#L6 We were ignoring this error due to `version_compare` being reported as a false positive. After https://github.com/koalaman/shellcheck/commit/4f81dbe839091a06a5cfaea695cf1c451ff07565 this was fixed and now it produces one `SC2329` for the whole function instead of multiple SC2137. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
35 lines
732 B
Makefile
35 lines
732 B
Makefile
TEST_IMAGE?=ubuntu:22.04
|
|
VERSION?=
|
|
CHANNEL?=
|
|
|
|
VOLUME_MOUNTS=-v "$(CURDIR)":/v
|
|
SHELLCHECK_EXCLUSIONS=$(addprefix -e, SC1091 SC1117 SC2317 SC2329)
|
|
SHELLCHECK=docker run --rm $(VOLUME_MOUNTS) -w /v koalaman/shellcheck:stable $(SHELLCHECK_EXCLUSIONS)
|
|
|
|
ENVSUBST_VARS=LOAD_SCRIPT_COMMIT_SHA
|
|
|
|
.PHONY: build
|
|
build: build/install.sh
|
|
|
|
build/install.sh: install.sh
|
|
mkdir -p $(@D)
|
|
LOAD_SCRIPT_COMMIT_SHA='$(shell git rev-parse HEAD)' envsubst '$(addprefix $$,$(ENVSUBST_VARS))' < $< > $@
|
|
|
|
.PHONY: shellcheck
|
|
shellcheck: build/install.sh
|
|
$(SHELLCHECK) $<
|
|
|
|
.PHONY: test
|
|
test: build/install.sh
|
|
docker run --rm -i \
|
|
$(VOLUME_MOUNTS) \
|
|
-w /v \
|
|
-e VERSION \
|
|
-e CHANNEL \
|
|
$(TEST_IMAGE) \
|
|
sh "$<"
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) -r build/
|