-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
57 lines (42 loc) · 1.57 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
DOCKER_REPO ?= gcr.io/online-bridge-hackathon-2020
GAME_SERVER_VERSION ?= 0.0.0-dev
USER_APP_VERSION ?= 0.0.0-dev
GAME_SERVER_TAG=${DOCKER_REPO}/game-server:${GAME_SERVER_VERSION}
USER_APP_TAG=${DOCKER_REPO}/user-app:${USER_APP_VERSION}
USER_APP_EXTERNAL_HOSTNAME ?= play.hackathon.globalbridge.app
GAME_SERVER_EXTERNAL_HOSTNAME ?= api.hackathon.globalbridge.app
PLAY_ENGINE_K8S_NS ?= play-engine
GCP_PROJECT ?= online-bridge-hackathon-2020
GKE_CLUSTER_NAME ?= hackathon-cluster
GKE_ZONE ?= europe-west3-b
dev:
docker-compose up --build --remove-orphans
stop:
docker-compose down
clear:
docker-compose rm -v
release: build push
build: build_game_server build_user_app
push: push_game_server push_user_app
build_game_server:
docker build -t ${GAME_SERVER_TAG} -f Dockerfile.gameServer .
build_user_app:
docker build -t ${USER_APP_TAG} -f Dockerfile.userApp .
push_game_server:
docker push ${GAME_SERVER_TAG}
push_user_app:
docker push ${USER_APP_TAG}
deploy: set_gcp_context ensure_ns
helm upgrade --install play-engine ./chart \
--set userApp.image="${USER_APP_TAG}" \
--set userApp.externalHostname="${USER_APP_EXTERNAL_HOSTNAME}" \
--set gameServer.image="${GAME_SERVER_TAG}" \
--set gameServer.externalHostname="${GAME_SERVER_EXTERNAL_HOSTNAME}" \
--namespace ${PLAY_ENGINE_K8S_NS} \
--history-max=10
uninstall: set_gcp_context
helm del play-engine --namespace ${PLAY_ENGINE_K8S_NS}
set_gcp_context:
gcloud container clusters get-credentials ${GKE_CLUSTER_NAME} --zone ${GKE_ZONE} --project ${GCP_PROJECT}
ensure_ns:
kubectl create ns ${PLAY_ENGINE_K8S_NS} || :