-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTaskfile.yml
More file actions
35 lines (29 loc) · 1.25 KB
/
Copy pathTaskfile.yml
File metadata and controls
35 lines (29 loc) · 1.25 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
# https://taskfile.dev
version: "3"
vars:
FN_NAME: function-deletion-protection
XPKG_REPO: xpkg.upbound.io/crossplane-contrib/{{.FN_NAME}}
VERSION: 0.2.0
tasks:
clean:
desc: Removes Artifacts
cmds:
- docker rmi -f {{.FN_NAME}}:v{{.VERSION}}
- rm -f {{.FN_NAME}}-*.xpkg
- rm -f {{.FN_NAME}}-*.tar
- rm -f {{.FN_NAME}}
build-docker:
cmds:
- for: [amd64, arm64]
cmd: docker buildx build --platform linux/{{.ITEM}} . --tag=test:v1 --target=image --output type=docker,dest={{.FN_NAME}}-runtime-{{.ITEM}}-v{{.VERSION}}.tar
desc: Builds the function into a deployable Docker image and saves it as a tar file.
build-xpkg:
cmds:
- for: [amd64, arm64]
cmd: crossplane xpkg build -f package --embed-runtime-image-tarball={{.FN_NAME}}-runtime-{{.ITEM}}-v{{.VERSION}}.tar -o {{.FN_NAME}}-{{.ITEM}}-v{{.VERSION}}.xpkg
deps: [build-docker]
desc: Creates a Crossplane .xpkg file from a Docker tar file.
push-xpkg:
desc: Pushes Crossplane package to an OCI repository. Please ensure the repository exists before pushing.
cmds:
- cmd: crossplane xpkg push {{.XPKG_REPO}}:v{{.VERSION}} --package-files {{.FN_NAME}}-amd64-v{{.VERSION}}.xpkg,{{.FN_NAME}}-arm64-v{{.VERSION}}.xpkg