-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (54 loc) · 1.73 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
67
68
69
70
71
include .env
# set default shell
SHELL = bash -e -o pipefail
default: run-dev
.PHONY: install
install:
go mod tidy
go mod vendor
.PHONY: lint
lint:
golangci-lint run
.PHONY: build
build:
mkdir -p bin
go build -o bin/gomora-dapp \
cmd/main.go
.PHONY: build-dev
build-dev:
mkdir -p bin
go build -race -o bin/gomora-dapp \
cmd/main.go
.PHONY: test
test:
go test -race -v -p 1 ./...
.PHONY: run
run: build
./bin/gomora-dapp
.PHONY: run-dev
run-dev: build-dev
./bin/gomora-dapp
.PHONY: up
up:
docker compose down
docker compose up -d --build
.PHONY: schema
schema:
mkdir -p infrastructures/database/mysql/migrations
migrate create -ext sql -dir infrastructures/database/mysql/migrations -seq ${NAME}
.PHONY: migrate-up
migrate-up:
migrate -path infrastructures/database/mysql/migrations -database "mysql://${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_DATABASE}" -verbose up ${STEPS}
.PHONY: migrate-down
migrate-down:
migrate -path infrastructures/database/mysql/migrations -database "mysql://${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_DATABASE}" -verbose down ${STEPS}
.PHONY: migrate-version
migrate-version:
migrate -path infrastructures/database/mysql/migration -database "mysql://${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_DATABASE}" version
.PHONY: migrate-force
migrate-force:
migrate -path infrastructures/database/mysql/migration -database "mysql://${DB_USERNAME}:${DB_PASSWORD}@tcp(${DB_HOST}:${DB_PORT})/${DB_DATABASE}" force ${STEPS}
.PHONY: contract-build
contract-build:
rm -rf infrastructures/smartcontracts/greeter/Greeter.go
abigen --abi=infrastructures/smartcontracts/build/Greeter.abi --pkg=greeter --out=infrastructures/smartcontracts/greeter/Greeter.go