-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (30 loc) · 1.1 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
KO_DOCKER_REPO ?= ko.local
STARLARK ?= ./starlark
STARLARK_IMAGE ?= $(KO_DOCKER_REPO)/starlark:latest
.EXPORT_ALL_VARIABLES:
.PHONY: build
build:
go build -o starlark starlark.go
.PHONY: lint
lint:
golangci-lint run -v --timeout 10m
.PHONY: container
container:
ko build --base-import-paths
.PHONY: test-bin
test-bin:
rm -rf _tmp _results
kpt fn source examples | kpt fn eval - --truncate-output=false --exec $(STARLARK) --fn-config example-function-config/set-annotation.yaml | kpt fn sink _tmp
make validate-test-result
.PHONY: test-container
test-container:
rm -rf _tmp _results
kpt fn source examples | kpt fn eval --results-dir _results - --image $(STARLARK_IMAGE) --fn-config example-function-config/set-annotation.yaml | kpt fn sink _tmp
make validate-test-result
.PHONY: validate-test-result
validate-test-result:
cat _tmp/deployment.yaml | yq '.metadata.annotations.foo' | grep bar
.PHONY: test-non-standard
test-non-standard:
rm -rf _tmp _results
kpt fn source examples | kpt fn eval - --truncate-output=false --exec $(STARLARK) --fn-config example-function-config/recursion.yaml | kpt fn sink _tmp