-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (39 loc) · 1.64 KB
/
Makefile
File metadata and controls
51 lines (39 loc) · 1.64 KB
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
.PHONY: generate lint test bench build render render-check xpkg clean stdlib-push stdlib-push-local
# Run code generation (deepcopy methods + CRD schemas)
generate:
go generate ./...
# Run linter
lint:
golangci-lint run
# Run tests
test:
go test -race -count=1 ./...
# Run benchmarks
bench:
go test -bench=. -benchmem -count=1 -run='^$$' ./...
# Build container image
build: generate
docker build . --tag=runtime
# Run crossplane render with example fixtures
render: build
crossplane render example/xr.yaml example/composition.yaml example/functions.yaml
# Render and compare against expected output (non-zero exit on mismatch)
render-check: build
crossplane render example/xr.yaml example/composition.yaml example/functions.yaml --include-function-results 2>/dev/null | grep -v '^\s*generateName:' | diff - example/expected-output.yaml
# Build Crossplane package
xpkg: build
crossplane xpkg build -f package --embed-runtime-image=runtime -o function-starlark.xpkg
# Clean build artifacts
clean:
rm -rf package/input/ function-starlark.xpkg
# Stdlib publishing
STDLIB_REGISTRY ?= ghcr.io/wompipomp/starlark-stdlib
STDLIB_VERSION ?= dev
stdlib-push: ## Push stdlib to registry (STDLIB_REGISTRY and STDLIB_VERSION configurable)
cd stdlib && oras push $(STDLIB_REGISTRY):$(STDLIB_VERSION) \
--artifact-type application/vnd.fn-starlark.modules.v1+tar \
networking.star naming.star labels.star conditions.star
stdlib-push-local: ## Push stdlib to localhost:5000 for local testing
cd stdlib && oras push localhost:5000/starlark-stdlib:dev \
--artifact-type application/vnd.fn-starlark.modules.v1+tar \
networking.star naming.star labels.star conditions.star