-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 900 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (26 loc) · 900 Bytes
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
DATABASE_URL ?= postgres://yatsuiii@localhost/rivet_dev?sslmode=disable
.PHONY: help build test test-integration migrate-up migrate-down lint fmt clean
help:
@echo "Targets:"
@echo " build - build the rivet CLI"
@echo " test - run unit tests"
@echo " test-integration - run tests that hit a real Postgres (needs DATABASE_URL)"
@echo " migrate-up - apply migrations against DATABASE_URL"
@echo " lint - run go vet + staticcheck"
@echo " fmt - run gofmt"
build:
go build -o bin/rivet ./cmd/rivet
test:
go test ./...
test-integration:
RIVET_TEST_DATABASE_URL=$(DATABASE_URL) go test -tags=integration ./...
migrate-up:
psql "$(DATABASE_URL)" -f migrations/001_initial.sql
migrate-down:
psql "$(DATABASE_URL)" -c "DROP TABLE IF EXISTS rivet_jobs CASCADE;"
lint:
go vet ./...
fmt:
gofmt -s -w .
clean:
rm -rf bin/ dist/