-
Notifications
You must be signed in to change notification settings - Fork 87
/
Taskfile.yaml
executable file
·69 lines (63 loc) · 1.95 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
63
64
65
66
67
68
69
---
version: "3"
vars:
PROJECT_DIR:
sh: "git rev-parse --show-toplevel"
includes:
charts: .taskfiles/charts.yaml
precommit: .taskfiles/pre-commit.yaml
schemas: .taskfiles/schemas.yaml
tasks:
default:
silent: true
cmds:
- task -l
lint:
desc: |-
run golangci-lint
cmds:
- golangci-lint run -c {{.GO_LINT_CONFIG}}
vars:
GO_LINT_CONFIG: ./.github/lint/golangci.yaml
test:
desc: |-
task APP=<app> CHANNEL=<channel> BASE=<true/false> test
cmds:
- task: download-goss
- >-
cue vet --schema '#Spec' ./metadata.json metadata.rules.cue
- >-
docker buildx build --progress=plain --load
-t {{.APP}}:{{.CHANNEL}}
--build-arg CHANNEL={{.CHANNEL}}s
--build-arg VERSION=$(bash cat ./VERSION)
{{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 ./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: ./.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