-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
44 lines (35 loc) · 1.33 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
[group('local')]
test:
go test -coverprofile cover.out -coverpkg=./... -v ./...
go tool cover -html cover.out -o cover.html
[group('local')]
make:
go build
[group('local')]
lint:
golangci-lint run --fix
server-mod := "gotify-server.mod"
docker-image := "gotify-build-arm64"
server-go-version := "1.22.4"
plugin-name := "gotify-slack-webhook"
[group('gotify')]
build-image:
# This is here because the official gotify/builder images are AMD64 only and I'm on a M1 Mac Book
docker build . -f build.Dockerfile -t {{docker-image}} --build-arg GO_VERSION={{server-go-version}}
[group('gotify')]
_build arch:
mkdir -p _build
docker run --rm -v "$PWD/.:/build" -w /build {{docker-image}} go build -mod=readonly -a -installsuffix cgo -ldflags="-w -s" -buildmode=plugin -o _build/{{plugin-name}}-{{arch}}.so
[group('gotify')]
build: (_build "linux-arm64")
[group('gotify')]
run:
docker run --rm -v "$PWD/_build:/app/data/plugins" -p 8080:80 gotify/server-arm64
[group('gotify')]
download-gotify-server-mod:
wget -LO {{server-mod}} https://raw.githubusercontent.com/gotify/server/master/go.mod
echo "Also note that the Go version must match with Gotiy server (set via ASDF)"
[group('gotify')]
verify-versions: download-gotify-server-mod
go run github.com/gotify/plugin-api/cmd/gomod-cap -from {{server-mod}} -to go.mod
go mod tidy