-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathMakefile
60 lines (44 loc) · 1.56 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
.PHONY: ci clean test build
ci: clean prep gen test build
build:
go build -tags=dev -o congo github.com/gopheracademy/congo
production:
go generate
go build -o congogithub.com/gopheracademy/congo
clean: pgdown
rm -rf app/
rm -rf client/
rm -rf js/
rm -rf schema/
rm -rf swagger/
prep:
go get -u github.com/goadesign/goa/...
go get -u github.com/goadesign/gorma/...
gen:
goagen --design github.com/gopheracademy/congo/design app
goagen --design github.com/gopheracademy/congo/design js
goagen --design github.com/gopheracademy/congo/design client
goagen --design github.com/gopheracademy/congo/design schema
goagen --design github.com/gopheracademy/congo/design swagger
goagen --design github.com/gopheracademy/congo/design gen --pkg-path=github.com/goadesign/gorma
cd ..
test: pgdown pgclean pgup
sleep 10
CONGOTEST_DEBUG=true CONGOTEST_DB_HOST=localhost CONGOTEST_DB_USERNAME=congo CONGOTEST_DB_NAME=congo CONGOTEST_DB_PORT=5432 CONGOTEST_DB_PASSWORD=congopass go test -v ./...
pgup:
docker-compose -f dc-postgres.yml up -d
pgdown:
docker-compose -f dc-postgres.yml down
pgclean:
docker-compose -f dc-postgres.yml rm
appdev:
CONGO_DEBUG=true CONGO_DB_HOST=localhost CONGO_DB_USERNAME=congo CONGO_DB_NAME=congo CONGO_DB_PORT=5432 CONGO_DB_PASSWORD=congopass ./congo
run: pgup build appdev
key_checks:
which ssh-keygen > /dev/null
which openssl > /dev/null
keys: key_checks
mkdir keys
ssh-keygen -t rsa -b 4096 -f ./keys/congo.rsa -t rsa -N ''
openssl genrsa -out ./keys/congo.key 4096
openssl req -new -key ./keys/congo.key -out ./keys/congo.csr