forked from owenthereal/jqplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (34 loc) · 771 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
SHELL=/bin/bash -o pipefail
GOBIN ?= $(CURDIR)/build
.PHONY: build
build:
yarn
go build -o $(GOBIN)/jqplay ./cmd/jqplay
.PHONY: test
test:
go test ./... -coverprofile=jqplay.c.out -covermode=atomic -count=1 -race -v
.PHONY: vet
vet:
docker \
run \
--rm \
-v $(CURDIR):/app \
-w /app \
golangci/golangci-lint:latest \
golangci-lint run --timeout 5m -v
TAG ?= latest
REPO ?= ghcr.io/owenthereal/jqplay
.PHONY: docker_build
docker_build:
docker buildx build --rm -t $(REPO):$(TAG) .
.PHONY: docker_push
docker_push: docker_build
docker push $(REPO):$(TAG)
.PHONY: setup
setup:
dropdb --if-exists jqplay
createdb jqplay
psql -d jqplay -f server/db.sql
.PHONY: start
start: setup build
DATABASE_URL="dbname=jqplay sslmode=disable" ./build/jqplay