2019-09-11 08:41:07 +00:00
|
|
|
SRC := ./BuildSourceImage.sh
|
2019-09-11 09:45:53 +00:00
|
|
|
CTR_IMAGE := localhost/containers/buildsourceimage
|
2019-09-11 09:13:02 +00:00
|
|
|
CTR_ENGINE ?= podman
|
2019-09-18 13:15:45 +00:00
|
|
|
cleanfiles =
|
2019-09-11 08:41:07 +00:00
|
|
|
|
|
|
|
all: validate
|
|
|
|
|
2019-09-18 13:15:45 +00:00
|
|
|
validate: .validate
|
2019-09-11 09:45:53 +00:00
|
|
|
|
2019-09-18 13:15:45 +00:00
|
|
|
cleanfiles += .validate
|
|
|
|
.validate: $(SRC)
|
|
|
|
shellcheck $(SRC) && touch $@
|
|
|
|
|
|
|
|
build-container: .build-container
|
|
|
|
|
|
|
|
cleanfiles += .build-container
|
|
|
|
.build-container: .validate Dockerfile $(SRC)
|
2019-09-11 09:13:02 +00:00
|
|
|
@echo
|
|
|
|
@echo "Building BuildSourceImage Container"
|
2019-09-18 13:15:45 +00:00
|
|
|
$(CTR_ENGINE) build --quiet --file Dockerfile --tag $(CTR_IMAGE) . && touch $@
|
2019-09-11 09:13:02 +00:00
|
|
|
|
|
|
|
.PHONY: test-integration
|
2019-09-18 13:15:45 +00:00
|
|
|
test-integration: .build-container
|
2019-09-11 09:13:02 +00:00
|
|
|
@echo
|
|
|
|
@echo "Running integration tests"
|
|
|
|
CTR_IMAGE=$(CTR_IMAGE) CTR_ENGINE=$(CTR_ENGINE) bats test/
|
2019-09-18 13:15:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
if [ -n "$(cleanfiles)" ] ; then rm -rf $(cleanfiles) ; fi
|