-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 810 Bytes
/
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
VERSION=0.3.0
DB_URL ?= postgres://postgres:postgres@localhost:5432/clipboard-share?sslmode=disable
# Run golangci-lint on code
lint:
golangci-lint run
# Run tests
test:
go test -v ./...
# Clean
clean:
rm -rf ./bin
# Migrate
# https://github.com/golang-migrate/migrate
migrate-up:
migrate -path ./migrations/sql -database "$(DB_URL)" up
migrate-down:
migrate -path ./migrations/sql -database "$(DB_URL)" down
# Build api
build: clean
go mod download
CGO_ENABLED=0 go build -o bin/app/app ./cmd/app/main.go
# Run
run:
go run ./cmd/app/main.go --config ./configs/app.json
# Docker
build-docker:
docker build -t clipboard-share-api:$(VERSION) .
build-docker-release:
make build-docker TAG_SUFFIX=
run-docker:
docker run -p 8080:8080 --name clipboard-share-api clipboard-share-api:$(VERSION)