-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathMakefile
31 lines (24 loc) · 853 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
IMAGE_NAME ?= helm-controller
ARCH ?= amd64
.DEFAULT_GOAL := ci
.PHONY: build test validate package clean
build:
DOCKER_BUILDKIT=1 docker build \
--target binary \
--output type=local,dest=. .
validate:
docker build --target dev --build-arg ARCH=$(ARCH) -t $(IMAGE_NAME)-dev .
docker run --rm $(IMAGE_NAME)-dev ./scripts/validate
test:
docker build --target dev --build-arg ARCH=$(ARCH) -t $(IMAGE_NAME)-dev .
docker run --rm $(IMAGE_NAME)-dev ./scripts/test
package: SHELL:=/bin/bash
package:
docker build --target artifacts --build-arg ARCH=$(ARCH) --output type=local,dest=. .
source ./scripts/version && IMAGE=$${REPO}/helm-controller:$${TAG}; \
docker build -t $${IMAGE} --target production .; \
echo $${IMAGE} > bin/helm-controller-image.txt; \
echo Built $${IMAGE}
clean:
rm -rf bin dist
ci: build validate test package