-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
121 lines (102 loc) · 2.98 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
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
115
116
117
118
119
120
121
version: '3'
vars:
IMG: makukha/multipython
tasks:
init:
desc: Initialize dev environment.
cmds:
- sh .dev/install-macports.sh
checkupd:
desc: Check for version updates.
cmds:
- docker buildx bake base
- docker run --rm -t {{.IMG}}:base py checkupd
news:*:
desc: Create news item {security|breaking|removed|deprecated|added|changed|fixed|docs|misc}.
vars:
ISSUE: {sh: git rev-parse --abbrev-ref HEAD | cut -d- -f1}
SECTION: '{{index .MATCH 0}}'
cmds:
- uvx towncrier create -c "{{.CLI_ARGS}}" "{{.ISSUE}}.{{.SECTION}}.md"
lint:
desc: Run linters.
cmds:
- hadolint Dockerfile
- shellcheck bin/*.sh tests/share/*.sh .dev/*.sh
build:
desc: Build all docker images.
cmds:
- docker buildx bake
build:*:
desc: Build specific target.
vars:
TARGET: "{{index .MATCH 0}}"
cmds:
- docker buildx bake {{.TARGET}}
clean:
desc: Prune local tags, images, and build cache.
vars:
TAGS:
sh: docker image ls --format json | jq -r '. | select(.Repository == "{{.IMG}}") | .Tag'
cmds:
- cmd: docker image rm {{.IMG}}
ignore_error: true
- cmd: 'docker image rm {{.IMG}}:{{.ITEM}}'
for: { var: TAGS }
ignore_error: true
- docker image prune
- docker builder prune
shell:*:
desc: Shell to image {base,tox,py*,latest}.
vars:
TAG: "{{index .MATCH 0}}"
cmds:
- docker run --rm -it {{.CLI_ARGS}} -h {{.TAG}} {{.IMG}}:{{.TAG}} /bin/bash
run:*:
desc: Run command in image {base,py*,latest} container.
cmds:
- docker run --rm -it {{.IMG}}:{{index .MATCH 0}} {{.CLI_ARGS}}
test:
desc: Run tests.
env:
BUILDKIT_PROGRESS: plain
cmds:
- docker buildx bake --no-cache test
# docs
docs:
desc: Update docs.
vars:
VERSION: {sh: uvx bump-my-version show current_version 2>/dev/null}
cmds:
- bash .dev/gen-package-versions.sh "{{.VERSION}}" > docs/gen/package-versions.md
- bash .dev/gen-image-digests.sh "{{.VERSION}}" > docs/gen/image-digests.txt
- docsub -i
docs/part/basic-usage.md
DOCKERHUB.md
README.md
# release
release:version:
desc: Bump release version.
cmds:
- uvx bump-my-version bump --dry-run --verbose release
- task: _bump
_bump:
internal: true
prompt: Version will be updated as above. Continue?
cmds:
- uvx bump-my-version bump release
release:changelog:
desc: Collect changelog entries.
vars:
VERSION: {sh: uvx bump-my-version show current_version 2>/dev/null}
cmds:
- towncrier build --yes --version "{{.VERSION}}"
release:push:
desc: Push base images to Docker Registry.
prompt: Release all images. Continue?
vars:
TARGETS:
sh: docker buildx bake --print 2>/dev/null | jq -r '.group.default.targets[]'
cmds:
- cmd: docker buildx bake --push {{.ITEM}}; sleep 30
for: { var: TARGETS }