forked from whitewater-guide/gorge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (45 loc) · 2.16 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
######################################################
# ⭣ Commands below run inside docker container #
######################################################
download:
go mod download
tools: download
cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %
generate: tools
go-bindata -o storage/migrations/sqlite/sqlite_migrations.go -pkg sqlite_migrations -prefix "storage/migrations/sqlite/" storage/migrations/sqlite/
go-bindata -o storage/migrations/postgres/postgres_migrations.go -pkg postgres_migrations -prefix "storage/migrations/postgres/" storage/migrations/postgres/
build: GOOS=linux
build: generate
go build -o /go/bin/gorge-server -ldflags="-s -w -X 'github.com/whitewater-guide/gorge/version.Version=$(VERSION)'" github.com/whitewater-guide/gorge/server
go build -o /go/bin/gorge-cli -ldflags="-s -w -X 'github.com/whitewater-guide/gorge/version.Version=$(VERSION)'" github.com/whitewater-guide/gorge/cli
test: generate
go test -count=1 ./...
test-nodocker: generate
go test -count=1 -v -tags=nodocker ./...
lint: tools
golangci-lint run
typescript: tools
go run ./typescriptify
run: tools
modd
######################################################
# ⭣ Commands below run on host machine #
######################################################
compose:
touch .env.development
docker-compose up
######################################################
# ⭣ Commands below run in CI #
######################################################
verify:
docker build --target tester -t gorge_tester .
# Extract index.d.ts from image
docker run --rm --entrypoint "/bin/sh" \
-v $(shell pwd):/extract gorge_tester -c "cp index.d.ts /extract"
prepare:
docker build --build-arg VERSION=$(VERSION) -t docker.pkg.github.com/whitewater-guide/gorge/gorge:latest .
docker tag docker.pkg.github.com/whitewater-guide/gorge/gorge:latest docker.pkg.github.com/whitewater-guide/gorge/gorge:$(VERSION)
publish:
docker login docker.pkg.github.com -u $(GITHUB_USER) -p $(GITHUB_TOKEN)
docker push docker.pkg.github.com/whitewater-guide/gorge/gorge:latest
docker push docker.pkg.github.com/whitewater-guide/gorge/gorge:$(VERSION)