-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathTaskfile.yml
More file actions
91 lines (74 loc) · 2.04 KB
/
Taskfile.yml
File metadata and controls
91 lines (74 loc) · 2.04 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
version: 3
vars:
OPERATOR_IMG:
sh: awk -F= '/ARG OPERATOR_IMAGE_DEFAULT=/ { print $2 ; exit }' olaris-op/Dockerfile
OPERATOR_TAG:
sh: git -C olaris-op rev-parse --short HEAD
RUNTIMES_TAG:
sh: git -C runtimes rev-parse --short HEAD
OPERATOR_SRC: "{{.OPERATOR_IMG}}:{{.OPERATOR_TAG}}"
OPERATOR_TGT:
sh: |
B64="$(echo {{.OPERATOR_SRC}} | /usr/bin/base64 -w0 )"
echo ~/.ops/{{OS}}-{{ARCH}}/images/kind/$B64
tasks:
default: task -l
clean:
desc: clean the intermediate artifacts
cmds:
- rm -vf ./ops ~/.ops/{{OS}}-{{ARCH}}/images/kind/*
build:
desc: build all
cmds:
- task: cli
- task: operator
- task: opsroot
- task: runtimes
image-save:
desc: save an a SRC image in the TGT file
requires: { vars: [SRC, TGT]}
cmds:
- docker save {{.SRC}} -o {{.TGT}}
cli:
desc: build the cli
dir: cli
cmds:
- go build -o ../ops cmd/ops/main.go
status:
- ! test -e ../ops
operator:
desc: build the operator
deps:
- cli
dir: olaris-op
cmds:
- echo Building {{.OPERATOR_SRC}}
- git tag -d $(git tag) && git tag {{.OPERATOR_TAG}}
- task b:build
- echo Saving {{.OPERATOR_TGT}}
- task: image-save
vars:
SRC: "{{.OPERATOR_SRC}}"
TGT: "{{.OPERATOR_TGT}}"
status:
- ! test -e "{{.OPERATOR_TGT}}"
opsroot:
desc: build current opsroot.json
dir: olaris
cmds:
- test -e opsroot.orig || jq . <opsroot.json >opsroot.orig
- >
jq <opsroot.orig >opsroot.json '
.config.images = {} |
.config.images.operator = "{{.OPERATOR_SRC}}"
'
- diff opsroot.orig opsroot.json || true
runtimes:
desc: build current runtimes.json
dir: runtimes
cmds:
- git tag -d $(git tag) && git tag {{.RUNTIMES_TAG}}
- task build-common
- task build
- task render-runtimes
- cp runtimes.json ../olaris/rutimes.json