-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
66 lines (52 loc) · 1.65 KB
/
Makefile
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
# SPDX-FileCopyrightText: 2023 froggie <legal@frogg.ie>
#
# SPDX-License-Identifier: OSL-3.0
tripreporter: deps-ui build-ui deps-server build-server test-server
##########################################################
# licensing
reuse-lint:
@which reuse || { echo "reuse not found! see https://reuse.software/"; exit 1; }
reuse lint || exit 1
##########################################################
# tests (gcc workaround added for Docker, see https://github.com/golang/go/issues/56755)
test-server:
CGO_ENABLED=0 go vet ./...
go test -vet=off ./...
##########################################################
# deps
deps-ui:
cd ui/; \
npm i
deps-server:
go get -u "github.com/cristalhq/jwt/v4"
go get -u "github.com/georgysavva/scany/v2"
go get -u "github.com/go-redis/redis"
go get -u "github.com/google/uuid"
go get -u "github.com/gorilla/mux"
go get -u "github.com/jackc/pgtype"
go get -u "github.com/jackc/pgx/v5"
go get -u "github.com/joho/godotenv"
go get -u "github.com/rs/cors"
go get -u "github.com/shopspring/decimal"
go get -u "go.uber.org/zap"
go get -u "golang.org/x/crypto"
go get -u "golang.org/x/exp/slices"
go mod tidy
##########################################################
# build
build-ui: deps-ui
cd ui/; \
npm run build
build-server:
go build -o tripreporter .
chmod +x tripreporter
##########################################################
# Run development frontend + backend.
# For normal development, you will want to run both at
# at the same time. dev-server provides the API and
# dev-ui provides the frontend, both on localhost:3000.
dev-ui:
cd ui/; \
npm run serve
dev-server: build-server
./tripreporter -dev