-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (30 loc) · 1002 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
33
34
35
36
BASE_DIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
CERTS_DIR=$(BASE_DIR)/certs
THINGY_DIR=$(BASE_DIR)/thingy
REGISTRY_DIR=$(BASE_DIR)/registry
# When on Windows, force shell to be cmd instead of bash or any other shell
ifeq ($(OS),Windows_NT)
SHELL=cmd.exe
endif
all: thingy registry
# Make sure the CA certificate is up-to date
ca:
$(MAKE) -C $(CERTS_DIR) ca.pem
# Build and deploy thingy to app engine
thingy:
ifeq ($(OS),Windows_NT)
cd $(THINGY_DIR); ng build --prod; gcloud app deploy --quiet
else
cd $(THINGY_DIR) && ng build --prod && gcloud app deploy --quiet
endif
# Build and deploy registry to app engine
# Note: the CA pem files must be uploaded to app engine too
registry: ca
ifeq ($(OS),Windows_NT)
copy $(CERTS_DIR)\\ca.pem $(CERTS_DIR)\\ca-key.pem $(REGISTRY_DIR)\\
cd $(REGISTRY_DIR); gcloud app deploy --quiet
else
cp $(CERTS_DIR)/ca.pem $(CERTS_DIR)/ca-key.pem $(REGISTRY_DIR)/
cd $(REGISTRY_DIR) && gcloud app deploy --quiet
endif
.PHONY: ca thingy registry all