-
Notifications
You must be signed in to change notification settings - Fork 24
/
Justfile
72 lines (61 loc) · 1.74 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
## Justfiles are modernized Makefiles.
## To install just:
## - macOS: `brew install just`
## - Ubuntu: `sudo apt install just`
## - Fedora: `sudo dnf install just`
## To list tasks: `just --list` (or `just`)
## To run a task: `just <task>`
## To set a variable: `just <task> <variable>=<value>`
## e.g. `just build-images image-tag=latest`
image-tag := "local"
list-tasks:
@just --list
generate:
#!/usr/bin/env bash
set -euxo pipefail
cd src/
go generate ./...
build-mapper:
#!/usr/bin/env bash
set -euxo pipefail
cd src/
go build -o ../bin/mapper ./mapper/cmd
build-kafka-watcher:
#!/usr/bin/env bash
set -euxo pipefail
cd src/
go build -o ../bin/kafka-watcher ./kafka-watcher/cmd
build-sniffer:
#!/usr/bin/env bash
set -euxo pipefail
cd src/
go build -o ../bin/sniffer ./sniffer/cmd
build: generate build-mapper build-kafka-watcher build-sniffer
build-mapper-image:
#!/usr/bin/env bash
set -euxo pipefail
cd src/
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t otterize/network-mapper:{{image-tag}} \
-f ../build/mapper.Dockerfile \
.
build-kafka-watcher-image:
#!/usr/bin/env bash
set -euxo pipefail
cd src/
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t otterize/kafka-watcher:{{image-tag}} \
-f ../build/kafka-watcher.Dockerfile \
.
build-sniffer-image:
#!/usr/bin/env bash
set -euxo pipefail
cd src/
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t otterize/sniffer:{{image-tag}} \
-f ../build/sniffer.Dockerfile \
.
build-images: generate build-mapper-image build-kafka-watcher-image build-sniffer-image