-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
32 lines (31 loc) · 944 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
OLD_SHA:=$(shell shasum -a 256 a_main-packr.go | cut -d' ' -f1)
NEW_SHA= $(shell shasum -a 256 a_main-packr.go | cut -d' ' -f1)
all: test install post
test:
packr
go test -v -count 1 ./...
go build
docker-compose --no-ansi -f docker-compose.yml up -d --force-recreate
sleep 5
./modelgen -c root:@localhost:3307 -d modelgen_tests -p models generate
golint -set_exit_status generated_models
rm -rf modelgen
rm -rf ./generated_models
test-ci:
go test -v -count 1 ./...
go build
docker-compose --no-ansi -f docker-compose.yml up -d --force-recreate
sleep 30 # annoying, but for ci.
./modelgen -c root:@localhost:3307 -d modelgen_tests -p models generate
golint -set_exit_status generated_models
rm -rf modelgen
rm -rf ./generated_models
clean:
docker rm -f modelgen-tests
install:
packr && go install
post:
@if [ "$(NEW_SHA)" != "$(OLD_SHA)" ]; then\
echo "sha comparison failed on a_main-packr.go";\
exit 1;\
fi