mirror of
https://github.com/docker/docker-install.git
synced 2026-11-20 10:03:11 +03:00
Simplifies CI to run through a simple `make test` target that has an underlying `TEST_IMAGE` variable which determines the distribution to run on. Also changes the Jenkinsfile to be declarative since the old one kind of sucked. Also adds a test for version pinning since that's something we rely on a lot. Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
34 lines
678 B
Makefile
34 lines
678 B
Makefile
TEST_IMAGE?=ubuntu:18.04
|
|
VERSION?=
|
|
CHANNEL?=
|
|
|
|
VOLUME_MOUNTS=-v "$(CURDIR)":/v
|
|
SHELLCHECK_EXCLUSIONS=$(addprefix -e, SC1091 SC1117)
|
|
SHELLCHECK=docker run --rm $(VOLUME_MOUNTS) -w /v koalaman/shellcheck $(SHELLCHECK_EXCLUSIONS)
|
|
|
|
ENVSUBST_VARS=SCRIPT_COMMIT_SHA
|
|
|
|
.PHONY: build
|
|
|
|
build/install.sh: install.sh
|
|
mkdir -p $(@D)
|
|
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/
|