Ensure invocation image has been build when running a make or make all command

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
Guillaume Lours 2019-09-23 22:47:54 +02:00 коммит произвёл Nicolas De loof
Родитель b118ccd82e
Коммит 54710d5e75
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -35,7 +35,7 @@ GO_BUILD = $(STATIC_FLAGS) go build -tags=$(BUILDTAGS) -ldflags=$(LDFLAGS)
GO_TEST = $(STATIC_FLAGS) go test -tags=$(BUILDTAGS) -ldflags=$(LDFLAGS)
GO_TESTSUM = $(STATIC_FLAGS) gotestsum --junitfile $(TEST_RESULTS_DIR)/$(TEST_RESULTS_PREFIX)$(1) -- -tags=$(BUILDTAGS) -ldflags=$(LDFLAGS)
all: bin/$(BIN_NAME) test
all: bin/$(BIN_NAME) build-invocation-image test
check_go_env:
@test $$(go list) = "$(PKG_NAME)" || \
@ -72,6 +72,12 @@ bin/$(BIN_NAME)-%.exe bin/$(BIN_NAME)-%: cmd/$(BIN_NAME) check_go_env
bin/%: cmd/% check_go_env
$(GO_BUILD) -o $@$(EXEC_EXT) ./$<
build-invocation-image: ## build invocation image if not present (internal usage, not diplayed in help)
@echo "Build invocation image if needed"
$(if $(shell docker images -q docker/cnab-app-base:$(TAG)),, \
$(MAKE) -f ./docker.Makefile invocation-image \
)
check: lint test
test: test-unit test-e2e ## run all tests