-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
63 lines (52 loc) · 2 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
OPERATOR_ASPECT_TAG ?= "ghcr.io/syntasso/kratix-cli/from-api-to-operator"
HELM_ASPECT_TAG ?= "ghcr.io/syntasso/kratix-cli/helm-resource-configure"
KRATIX_CLI_VERSION ?= "v0.1.0"
all: test build
.PHONY: test
test: # Run tests
./aspects/helm-promise/pipeline_test.bash
go run github.com/onsi/ginkgo/v2/ginkgo -r
build: # Build the binary
CGO_ENABLED=0 go build -o bin/kratix main.go
build-aspects: build-operator-promise-aspect build-helm-promise-aspect # build all aspects
build-and-push-aspects: # build and push all aspects
if ! docker buildx ls | grep -q "kratix-cli-image-builder"; then \
docker buildx create --name kratix-cli-image-builder; \
fi;
make build-and-push-operator-promise-aspect
make build-and-push-helm-promise-aspect
.PHONY: help
help: # Show help for each of the Makefile recipes.
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
build-operator-promise-aspect:
docker build \
--tag ${OPERATOR_ASPECT_TAG}:${KRATIX_CLI_VERSION} \
--tag ${OPERATOR_ASPECT_TAG}:latest \
--file aspects/operator-promise/Dockerfile \
.
build-and-push-operator-promise-aspect:
docker buildx build \
--builder kratix-cli-image-builder \
--push \
--platform linux/arm64,linux/amd64\
--tag ${OPERATOR_ASPECT_TAG}:${KRATIX_CLI_VERSION} \
--tag ${OPERATOR_ASPECT_TAG}:latest \
--file aspects/operator-promise/Dockerfile \
.
build-helm-promise-aspect:
docker build \
--tag ${HELM_ASPECT_TAG}:${KRATIX_CLI_VERSION} \
--tag ${HELM_ASPECT_TAG}:latest \
--file aspects/operator-promise/Dockerfile \
.
build-and-push-helm-promise-aspect:
docker buildx build \
--builder kratix-cli-image-builder \
--push \
--platform linux/arm64,linux/amd64\
--tag ${HELM_ASPECT_TAG}:${KRATIX_CLI_VERSION} \
--tag ${HELM_ASPECT_TAG}:latest \
--file aspects/helm-promise/Dockerfile \
aspects/helm-promise
release:
goreleaser release --auto-snapshot --prepare --clean --config .goreleaser.yaml