-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
62 lines (58 loc) · 1.89 KB
/
Taskfile.yaml
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
---
version: "3"
vars:
CHANNEL: '{{ default "stable" .CHANNEL }}'
tasks:
default:
silent: true
cmds:
- task -l
build:
desc: |-
task APP=<app> CHANNEL=<channel> build
vars:
MULTIPLATFORM: '{{ default "false" .MULTIPLATFORM }}'
cmds:
- >-
podman build
--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
--manifest {{.APP}}:{{.CHANNEL}}
.
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
- task: build
- >-
./.goss/dgoss run {{.APP}}:{{.CHANNEL}} {{if eq .BASE "true"}}tail -f /dev/null{{end}}
env:
CONTAINER_RUNTIME: podman
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
download-goss:
silent: true
vars:
# renovate: datasource=github-releases depName=aelsabbahy/goss
GOSS_VERSION: v0.3.20
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