-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (55 loc) · 1.68 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BUILD_DIR=./build
BUILD_DEPLOY_DIR=$(BUILD_DIR)/deploy
BUILD_PACKAGE_DIR=$(BUILD_DIR)/package
SERVICE_DOCKERFILE=$(BUILD_PACKAGE_DIR)/service.Dockerfile
SERVICES=circle proximity scoring
EXECUTABLES=app consumer
BINARY_NAME_APP=app.out
BINARY_NAME_CONSUMER=consumer.out
BINARY_UNIX=$(BINARY_NAME)_unix
GOOGLE_GCR_HOSTNAME=gcr.io
GOOGLE_PROJECT_ID=spatiumsocialis
ifeq ($(env),)
env := dev
endif
all: deps test build
test:
PROJECT_ROOT=$(PWD) ${GOTEST} -coverprofile=/tmp/coverage.out ./pkg/... $(ARGS)
.PHONY: test
coverage:
go tool cover -html=/tmp/coverage.out
build-token:
$(GOBUILD) -o ./tools/tokengen/cmd/tokengen/tokengen.out ./tools/tokengen/cmd/tokengen
token:
sh ./scripts/token.sh $(uid)
push-deps:
docker push ${GOOGLE_GCR_HOSTNAME}/${GOOGLE_PROJECT_ID}/deps:latest
push:
sh ./scripts/push.sh ${PWD} ${BUILD_PACKAGE_DIR} ${BUILD_DEPLOY_DIR} ${service}
pull:
sh ./scripts/pull.sh ${PWD} ${BUILD_DEPLOY_DIR} ${service}
build-deps:
sh ./scripts/build-deps.sh ${GOOGLE_GCR_HOSTNAME} ${GOOGLE_PROJECT_ID} ${BUILD_PACKAGE_DIR} ${PWD}
start:
sh ./scripts/start.sh ${PWD} ${BUILD_DEPLOY_DIR} ${env} ${service}
build: build-deps
sh ./scripts/build.sh ${PWD} ${SERVICE_DOCKERFILE} ${BUILD_DEPLOY_DIR} ${service}
stop:
docker-compose -f ${BUILD_DEPLOY_DIR}/docker-compose.yml down ${service}
@echo Services torn down
deploy:
sh ./scripts/deploy.sh
ssh:
gcloud beta compute ssh --zone "us-central1-a" "spatium-prod" --project "spatiumsocialis"
dockerhost:
sh ./scripts/dockerhost.sh
dockerhost-mac:
sh ./scripts/dockerhost_mac.sh
dockerhost-mac-set:
sh ./scripts/dockerhost_mac_set.sh