-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathjustfile
79 lines (58 loc) · 2.16 KB
/
justfile
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
target := "x86_64-unknown-linux-gnu"
static := 'false'
profile := 'debug' # or 'release'
_just-cargo := 'just-cargo profile=' + profile + ' target=' + target
_features := if static == 'true' { '--features=openssl-vendored' } else { '' }
build: fetch cli-build controller-build-image
test-build: fetch cli-test-build controller-test-build
fetch:
@{{ _just-cargo }} fetch
clippy:
@{{ _just-cargo }} clippy --frozen
# === CLI ===
cli-bin := 'target' / target / profile / 'linkerd-failover'
cli-version:
@just-cargo crate-version linkerd-failover-cli
cli-build: fetch
@{{ _just-cargo }} build --frozen \
--package=linkerd-failover-cli \
--bin=linkerd-failover \
{{ _features }}
du -sh {{ cli-bin }}
sha256sum {{ cli-bin }}
cli-test:
@{{ _just-cargo }} test --package=linkerd-failover-cli --frozen
cli-test-build:
@{{ _just-cargo }} test-build --package=linkerd-failover-cli --frozen
# === Controller ===
controller-bin := 'target' / target / profile / 'linkerd-failover-controller'
controller-version:
@just-cargo crate-version linkerd-failover-controller
controller-build: fetch
@{{ _just-cargo }} build --frozen \
--package=linkerd-failover-controller \
{{ _features }}
du -sh {{ controller-bin }}
sha256sum {{ controller-bin }}
controller-build-image *flags:
docker buildx build . {{ flags }}
controller-clippy:
@{{ _just-cargo }} clippy --package=linkerd-failover-controller --frozen
controller-test:
@{{ _just-cargo }} test --package=linkerd-failover-controller --frozen
controller-test-build:
@{{ _just-cargo }} test-build --package=linkerd-failover-controller --frozen
# Error if the crate versions do not match the expected value
assert-version expected:
#!/usr/bin/env bash
set -euo pipefail
ex=0
if [ "$(just cli-version)" != '{{ expected }}' ]; then
echo "CLI version mismatch: $(just cli-version) != {{ expected }}" >&2
ex=$(( ex + 1 ))
fi
if [ "$(just controller-version)" != '{{ expected }}' ]; then
echo "Controller version mismatch: $(just cli-version) != {{ expected }}" >&2
ex=$(( ex + 1 ))
fi
exit $ex