~bigbes/huntsman

ref: 766fa8055977fbe223afd8a84bcf37a3d13bb1ce huntsman/Justfile -rw-r--r-- 759 bytes
766fa805 — Eugene Blikh Add BSD 2-Clause license 6 days ago
                                                                                
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
binary := "huntsman"
version := `git describe --tags --always 2>/dev/null || echo dev`
commit := `git rev-parse --short HEAD 2>/dev/null || echo none`
date := `date -u +%Y-%m-%dT%H:%M:%SZ`

ldflags := "-X main.version=" + version + " -X main.commit=" + commit + " -X main.date=" + date

default:
    @just --list

build:
    go build -ldflags "{{ldflags}}" -o {{binary}} ./cmd/server

run: build
    ./{{binary}} -config config.yaml

dev:
    go run ./cmd/server -config config.yaml

test:
    go test -race ./...

lint:
    golangci-lint run ./...

fmt:
    gofmt -s -w .
    goimports -w .

tidy:
    go mod tidy

docker-build:
    docker build -t {{binary}}:{{version}} .

docker-run:
    docker compose up -d --build

docker-stop:
    docker compose down