forked from agntcy/slim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
59 lines (48 loc) · 1.7 KB
/
Copy pathTaskfile.yaml
File metadata and controls
59 lines (48 loc) · 1.7 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
52
53
54
55
56
57
# Copyright AGNTCY Contributors (https://github.com/agntcy)
# SPDX-License-Identifier: Apache-2.0
version: "3"
# Taskfile for the client applications deployment
vars:
BINDINGS_EXAMPLES_IMAGE: '{{ .BINDINGS_EXAMPLES_IMAGE | default "agntcy/slim/bindings-examples:latest" }}'
KIND_CLUSTER_NAMES: '{{ .KIND_CLUSTER_NAMES | default "slim-cluster" }}'
tasks:
bindings-examples:build:
internal: true
desc: Build bindings-examples Docker image (skipped if image exists locally)
status:
- docker image inspect {{.BINDINGS_EXAMPLES_IMAGE}} >/dev/null 2>&1
cmds:
- docker build -t {{.BINDINGS_EXAMPLES_IMAGE}} -f Dockerfile .
bindings-examples:prepare:
desc: Build bindings-examples image if missing and load it into Kind cluster(s); clusters must exist
deps:
- bindings-examples:build
cmds:
- |
set -e
for c in $(echo "{{.KIND_CLUSTER_NAMES}}" | tr ',' ' '); do
echo "Loading {{.BINDINGS_EXAMPLES_IMAGE}} into kind cluster $c"
kind load docker-image {{.BINDINGS_EXAMPLES_IMAGE}} --name "$c"
done
k8s:apply:
desc: Apply k8s template to namespace
requires:
vars:
- TEMPLATE
- NAMESPACE
internal: true
cmds:
- cmd: |
echo "Applying k8s template '{{ .TEMPLATE }}' to namespace '{{ .NAMESPACE }}'"
kubectl apply -n {{ .NAMESPACE }} -f {{ .TEMPLATE }}
k8s:delete:
desc: Delete k8s template from namespace
requires:
vars:
- TEMPLATE
- NAMESPACE
internal: true
cmds:
- cmd: |
echo "Deleting k8s template '{{ .TEMPLATE }}' from namespace '{{ .NAMESPACE }}'"
kubectl delete -n {{ .NAMESPACE }} -f {{ .TEMPLATE }}