-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
55 lines (51 loc) · 1.74 KB
/
Taskfile.yml
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
---
version: "3"
vars:
CHANNEL: '{{ default "stable" .CHANNEL }}'
tasks:
default:
silent: true
cmds:
- task -l
test:
desc: |-
task APP=<app> CHANNEL=<channel> BASE=<true/false> test
cmds:
- task: download-goss
- >-
cue vet --schema '#Spec' ./apps/{{.APP}}/metadata.json metadata.rules.cue
- >-
docker buildx build --progress=plain --load
-t {{.APP}}:{{.CHANNEL}}
--build-arg CHANNEL={{.CHANNEL}}
--build-arg VERSION=$(bash ./.github/scripts/upstream.sh "{{.APP}}" "{{.CHANNEL}}")
{{if eq .MULTIPLATFORM "true"}}
--platform $(jq -r '.channels[] | select(.name=="{{.CHANNEL}}").platforms | join(",")' ./apps/{{.APP}}/metadata.json)
{{else}}
--platform "linux/$(uname -m | sed 's/x86_64/amd64/')"
{{end}}
-f ./apps/{{.APP}}/Dockerfile .
- >-
./.goss/dgoss run {{.APP}}:{{.CHANNEL}} {{if eq .BASE "true"}}tail -f /dev/null{{end}}
env:
CONTAINER_RUNTIME: docker
GOSS_PATH: ./.goss/goss
GOSS_OPTS: --sleep 5s --retry-timeout 60s --color --format documentation
GOSS_SLEEP: 2
GOSS_FILE: ./apps/{{.APP}}/ci/goss.yaml
GOSS_FILES_STRATEGY: cp
vars:
MULTIPLATFORM: '{{ default "false" .MULTIPLATFORM }}'
download-goss:
silent: true
vars:
GOSS_VERSION: v0.3.21
cmds:
- mkdir -p ./.goss
- curl -fsSL -o ./.goss/goss https://github.com/aelsabbahy/goss/releases/download/{{.GOSS_VERSION}}/goss-linux-amd64
- chmod +x ./.goss/goss
- curl -fsSL -o ./.goss/dgoss https://raw.githubusercontent.com/aelsabbahy/goss/{{.GOSS_VERSION}}/extras/dgoss/dgoss
- chmod +x ./.goss/dgoss
status:
- test -f ./.goss/goss
- test -f ./.goss/dgoss