-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (33 loc) · 1.01 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
.PHONY: enter
enter:
docker-compose exec goworkspace bash -c "export COLUMNS=`tput cols`; export LINES=`tput lines`; exec bash"
.PHONY: deps
deps:
dep ensure -v --vendor-only
.PHONY: build
build:
go build -v -o bin/go-postgresql-dhcp-server .
.PHONY: test
test:
go test -v ./...
.PHONY: watch-bin
watch-bin:
reflex -r "^bin/go-postgresql-dhcp-server$$" -s -- /vagrant/bin/go-postgresql-dhcp-server -v
.PHONY: watch-go
watch-go:
reflex -r "\.go$$" -s -- make build
.PHONY: docker-build
docker-build:
docker build . -t itsalex/go-postgresql-dhcp-server
.PHONY: db-schema
db-schema:
echo "CREATE TABLE reservations(mask_subnet cidr NOT NULL, mac macaddr NOT NULL UNIQUE, ip inet NOT NULL UNIQUE);" | docker-compose exec -T --user postgres postgres psql dhcp4
.PHONY: db-fixtures
db-fixtures:
cat sample-data.sql | docker-compose exec -T --user postgres postgres psql dhcp4
.PHONY: clean
clean:
docker-compose stop | true
docker-compose rm -f | true
vagrant destroy -f | true
rm -rf ./data-dhcp4/ bin/ vendor/ .vagrant