Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export KO_DOCKER_REPO := gcr.io/$(PROJECT_ID)/ate-images
GO := go
KO := hack/run-tool.sh ko

# Flags every ko image build gets, e.g. `make build-images KO_FLAGS=--push=false`.
# Empty by default, so ko runs on its own defaults and whatever .ko.yaml configures.
KO_FLAGS ?=
Comment thread
annapendleton marked this conversation as resolved.

# Binaries
BINDIR := bin/
ATECTL := $(BINDIR)/kubectl-ate
Expand All @@ -33,6 +37,31 @@ VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo d
VERSION_PKG := github.com/agent-substrate/substrate/internal/version
LDFLAGS := -X=$(VERSION_PKG).Version=$(VERSION)

# Every image the installer can deploy, defined once. These two sets together
# have to cover images.Components in cmd/ate-setup/internal/images: a package
# missing here has no image for a build from source, and one missing there has
# none for an install from a release.
CONTROL_PLANE_IMAGES := ./cmd/ateapi \
./cmd/atecontroller \
./cmd/atelet \
./cmd/atenet \
./cmd/podcertcontroller
WORKER_IMAGES := ./cmd/ateom-gvisor \
./cmd/ateom-microvm
DEMO_IMAGES := ./demos/counter \
./demos/egress \
./demos/multi-template/fspersist \
./demos/sandbox
ALL_IMAGES := $(CONTROL_PLANE_IMAGES) $(WORKER_IMAGES)

# Developer builds may leave components out, e.g. the microvm image, the one
# image built from a debian base rather than distroless static:
# make build-images SKIP_IMAGES=./cmd/ateom-microvm
# Overriding IMAGES or DEMOS on the command line builds exactly that set.
SKIP_IMAGES ?=
IMAGES := $(filter-out $(SKIP_IMAGES),$(ALL_IMAGES))
DEMOS := $(filter-out $(SKIP_IMAGES),$(DEMO_IMAGES))

.PHONY: all
all: build

Expand All @@ -41,12 +70,9 @@ build: build-images build-atectl build-ate-setup

.PHONY: build-images
build-images:
$(KO) build \
$(KO) build $(KO_FLAGS) \
--ldflags="$(LDFLAGS)" \
./cmd/ateapi \
./cmd/atelet \
./cmd/podcertcontroller \
./cmd/atenet
$(IMAGES)

.PHONY: build-atectl
build-atectl:
Expand All @@ -64,7 +90,9 @@ build-atenet:

.PHONY: build-demos
build-demos:
$(KO) build --ldflags="$(LDFLAGS)" ./demos/counter ./demos/egress
$(KO) build $(KO_FLAGS) \
--ldflags="$(LDFLAGS)" \
$(DEMOS)

.PHONY: test
test:
Expand Down
Loading