Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 54710d5

Browse files
gloursndeloof
authored andcommitted
Ensure invocation image has been build when running a make or make all command
Signed-off-by: Guillaume Lours <[email protected]>
1 parent b118ccd commit 54710d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ GO_BUILD = $(STATIC_FLAGS) go build -tags=$(BUILDTAGS) -ldflags=$(LDFLAGS)
3535
GO_TEST = $(STATIC_FLAGS) go test -tags=$(BUILDTAGS) -ldflags=$(LDFLAGS)
3636
GO_TESTSUM = $(STATIC_FLAGS) gotestsum --junitfile $(TEST_RESULTS_DIR)/$(TEST_RESULTS_PREFIX)$(1) -- -tags=$(BUILDTAGS) -ldflags=$(LDFLAGS)
3737

38-
all: bin/$(BIN_NAME) test
38+
all: bin/$(BIN_NAME) build-invocation-image test
3939

4040
check_go_env:
4141
@test $$(go list) = "$(PKG_NAME)" || \
@@ -72,6 +72,12 @@ bin/$(BIN_NAME)-%.exe bin/$(BIN_NAME)-%: cmd/$(BIN_NAME) check_go_env
7272
bin/%: cmd/% check_go_env
7373
$(GO_BUILD) -o $@$(EXEC_EXT) ./$<
7474

75+
build-invocation-image: ## build invocation image if not present (internal usage, not diplayed in help)
76+
@echo "Build invocation image if needed"
77+
$(if $(shell docker images -q docker/cnab-app-base:$(TAG)),, \
78+
$(MAKE) -f ./docker.Makefile invocation-image \
79+
)
80+
7581
check: lint test
7682

7783
test: test-unit test-e2e ## run all tests

0 commit comments

Comments
 (0)