-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.dist.yml
More file actions
114 lines (99 loc) · 2.97 KB
/
Copy pathTaskfile.dist.yml
File metadata and controls
114 lines (99 loc) · 2.97 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# https://taskfile.dev
version: "3"
includes:
docs: ./taskfiles/Taskfile.docs.yml
md: ./taskfiles/Taskfile.md.yml
lint:
taskfile: ./taskfiles/Taskfile.lint.yml
flatten: true
silent: true
# env:
# BUILDKIT_PROGRESS: plain
tasks:
dc:
desc: Run a docker compose command
internal: true
vars:
FIXUID:
sh: echo ${FIXUID:-$(id -u)}
FIXGID:
sh: echo ${FIXGID:-$(id -g)}
cmds:
- FIXUID={{ .FIXUID }} FIXGID={{ .FIXGID }} docker compose {{ .SUB_CMD }} {{ .CLI_ARGS }}
dc:build:
desc: Run docker compose build
cmds:
- task: dc
vars:
SUB_CMD: --profile=* build
dc:run:*:
desc: Run a one-off docker compose command
vars:
SERVICE: '{{ index .MATCH 0 }}'
RUN_FLAGS: '{{ .RUN_FLAGS | default "" }}'
USER_FLAG: '{{ (ne (.NON_ROOT | default "true") "false") | ternary " --user $(id -u):$(id -g)" "" }}'
COMPOSE_SERVICES:
sh: COMPOSE_PROFILES="*" docker compose config --services
cmds:
- task: dc
vars:
SUB_CMD: 'run --rm {{ .RUN_FLAGS }} {{ .USER_FLAG }} {{ .SERVICE }} {{ .SUB_CMD }}'
CLI_ARGS: '{{ .CLI_ARGS }}'
requires:
vars:
- name: SERVICE
enum:
ref: .COMPOSE_SERVICES | splitLines | compact
dc:shell:
desc: Shell into a docker compose service
cmds:
- task: dc
vars:
SUB_CMD: "run --tty --rm go-builder /bin/bash"
CLI_ARGS: "{{.CLI_ARGS}}"
build:
desc: Build Specs cli
vars:
SPECS_VERSION:
sh: git describe --tags --always --dirty="-dev" 2>/dev/null || echo "dev"
cmds:
- task: lint
- >-
docker buildx bake --file compose.yml
--set "go-binary.output=type=local,dest=."
--set "go-binary.args.GOARCH={{ARCH}}"
--set "go-binary.args.GOOS={{OS}}"
--set "go-binary.args.SPECS_VERSION={{.SPECS_VERSION}}"
go-binary
test:
desc: Run go tests
cmds:
- task: dc:run:go-builder
vars:
SUB_CMD: "go test -tags=integration ./..."
test:update:
desc: Rewrite the golden files from the current output
summary: |
Regenerates internal/util/output/testdata/*.golden from what the renderer
produces now, then review the diff — that diff is the rendering change.
Scoped to the one package that defines -update: `go test ./... -update`
fails in every package that does not declare the flag.
cmds:
- task: dc:run:go-builder
vars:
SUB_CMD: "go test ./internal/util/output -update"
release:dry-run:
desc: Build a snapshot release locally without publishing
cmds:
- task: dc:run:goreleaser
vars:
SUB_CMD: release --snapshot --clean
cleanup:
desc: Cleanup workspace
summary: |
Cleanup of almost all gitignored files, untracked files and development containers.
The following files/dirs are excluded: none
cmds:
- git clean
-xd
--force