Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
63 lines (54 loc) · 1.75 KB
/
Copy pathTaskfile.yml
File metadata and controls
63 lines (54 loc) · 1.75 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
version: '3'
tasks:
default:
desc: Show available tasks
cmds:
- task --list
build:
desc: Build datumctl locally with go, embedding a real <last-tag>+<sha> version
vars:
LAST_TAG:
sh: git describe --tags --abbrev=0 2>/dev/null || echo v0.0.0
GIT_SHA:
sh: git rev-parse --short=8 HEAD
GIT_COMMIT:
sh: git rev-parse HEAD
DIRTY_SUFFIX:
sh: (git diff --quiet && git diff --cached --quiet) || echo -dev
cmds:
- go build -ldflags "-X k8s.io/component-base/version.gitVersion={{.LAST_TAG}}+{{.GIT_SHA}}{{.DIRTY_SUFFIX}} -X k8s.io/component-base/version.gitCommit={{.GIT_COMMIT}}" -o datumctl .
nix-update-hash:
desc: Automatically update the vendorHash in flake.nix after Go dependency changes
cmds:
- go run scripts/update-nix-hash.go
nix-build:
desc: Build the project with Nix
cmds:
# `nix build` only sees files git knows about (even untracked ones must be
# staged), so drop the last tag in a VERSION file and stage it with
# intent-to-add; flake.nix reads it to embed <last-tag>+<sha> in the
# binary. Cleaned up afterwards so it's never actually committed.
- defer: git reset -- VERSION && rm -f VERSION
- git describe --tags --abbrev=0 > VERSION
- git add -N VERSION
- nix build
nix-dev:
desc: Enter the Nix development shell
cmds:
- nix develop
nix-fmt:
desc: Format nix files
cmds:
- nix fmt
clean:
desc: Remove build artifacts
cmds:
- rm -rf result result-*
nix-check:
desc: Check flake syntax and run checks
cmds:
- nix flake check
notice:
desc: Regenerate the NOTICE file of third-party licenses
cmds:
- ./scripts/licenses/notice.sh