Files
docker-install/Makefile
T
Eli Uriegas dde1dc2b87 Simplify CI, it was too complicated
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>
2019-07-15 19:09:20 +00:00

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/