forked from artefactual-labs/enduro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
111 lines (87 loc) · 3.19 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
SHELL=/bin/bash
BUILD_TIME=$(shell date -u +%Y-%m-%dT%T%z)
GIT_COMMIT=$(shell git rev-parse --short HEAD)
LD_FLAGS= '-X "main.buildTime=$(BUILD_TIME)" -X main.gitCommit=$(GIT_COMMIT)'
GO_FLAGS= -ldflags=$(LD_FLAGS)
GOPATH=$(shell go env GOPATH)
GOBIN=$(GOPATH)/bin
GOCMD=go
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOTEST=$(GOCMD) test
GOGEN=$(GOCMD) generate
export PATH:=$(GOBIN):$(PATH)
run: enduro-dev
./build/enduro
enduro-dev:
mkdir -p ./build
$(GOBUILD) -trimpath -o build/enduro $(GO_FLAGS) -v
test:
$(GOTEST) -race -v ./...
lint:
golangci-lint run
generate:
find . -name fake -type d | xargs rm -rf
$(GOGEN) ./internal/...
migrations:
$(GOGEN) ./internal/db
bingen: migrations ui
goagen:
goa gen github.com/artefactual-labs/enduro/internal/api/design -o internal/api
tools:
cd / && env GO111MODULE=off go get -u github.com/myitcv/gobin
gobin \
github.com/golangci/golangci-lint/cmd/golangci-lint \
github.com/GeertJohan/go.rice/rice \
github.com/golang/mock/mockgen
clean:
rm -rf ./build ./dist
find . -name fake -type d | xargs rm -rf
find . -name rice-box.go -delete
release-test-config:
goreleaser --snapshot --skip-publish --rm-dist
release-test:
goreleaser --skip-publish
website:
hugo serve --source=website/
ui:
yarn --cwd ui install
yarn --cwd ui build
make ui-gen
ui-dev:
yarn --cwd ui serve
ui-gen:
cd / && env GO111MODULE=off go get -u github.com/myitcv/gobin
gobin github.com/GeertJohan/go.rice/rice
$(GOGEN) -v ./ui
ui-client:
@rm -rf $(CURDIR)/ui/src/client
@docker container run --rm --user $(shell id -u):$(shell id -g) --volume $(CURDIR):/local openapitools/openapi-generator-cli:v4.2.3 \
generate \
--input-spec /local/internal/api/gen/http/openapi.json \
--generator-name typescript-fetch \
--output /local/ui/src/openapi-generator/ \
--skip-validate-spec \
-p "generateAliasAsModel=true" \
-p "typescriptThreePlus=true" \
-p "withInterfaces=true"
@echo "@@@@ Please, review all warnings generated by openapi-generator-cli above!"
@echo "@@@@ We're using \`--skip-validate-spec\` to deal with Goa spec generation issues."
cadence-flush:
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "DROP DATABASE IF EXISTS cadence;"
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "DROP DATABASE IF EXISTS cadence_visibility;"
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "CREATE DATABASE IF NOT EXISTS cadence;"
docker-compose exec mysql mysql -hlocalhost -uroot -proot123 -e "CREATE DATABASE IF NOT EXISTS cadence_visibility;"
docker-compose run --rm cadence /seed.sh
docker-compose restart cadence
docker run -it --network=host --rm ubercadence/cli:master --address=127.0.0.1:7400 --domain=enduro domain register
cadence-seed:
docker-compose run --rm cadence /seed.sh
cadence-domain:
docker run -it --network=host --rm ubercadence/cli:master --address=127.0.0.1:7400 --domain=enduro domain register
db:
docker-compose exec --user=root mysql mysql -hlocalhost -uroot -proot123
flush:
docker-compose exec --user=root mysql mysql -hlocalhost -uroot -proot123 -e "drop database enduro"
docker-compose exec --user=root mysql mysql -hlocalhost -uroot -proot123 -e "create database enduro"
.PHONY: *