-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (60 loc) · 2.04 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# FRONTEND
zone := us-central1-f
release:
@$(MAKE) bundle
gsutil cp -r dist/ gs://${BUCKET_NAME}/cw-web-release
bundle:
yarn bundle
# push to instance?
# build container, publish release in container-registry, create/update instance
old_deploy:
$(MAKE) build_image \
&& $(MAKE) push_image \
&& $(MAKE) create_instance \
&& $(MAKE) progress
ssh:
gcloud compute ssh --project eternal-sunset-206422 \
--zone us-central1-f cw-web-instance
image:
docker build -t cw-web-image .
run:
docker run -it cw-web-image /bin/bash
push_image:
docker tag cw-web-image \
gcr.io/eternal-sunset-206422/cw-web-image:latest \
&& docker push gcr.io/eternal-sunset-206422/cw-web-image:latest
create:
gcloud compute instances create cw-web-instance${N} \
--image-family debian-9 \
--image-project debian-cloud \
--metadata-from-file startup-script=instance-bootstart.sh \
--machine-type f1-micro \
--scopes "userinfo-email,cloud-platform,storage-ro" \
--metadata release-url=gs://${BUCKET_NAME}/cw-web-release \
--zone ${zone} \
--tags "https-server,http-server"
# check progress of instance creation
progress:
gcloud compute instances get-serial-port-output cw-web-instance \
--zone us-central1-f
# google has a default 8080 already
firewall:
gcloud compute firewall-rules create http-server-allow-http-8080 \
--allow tcp:8080 \
--source-ranges 0.0.0.0/0 \
--target-tags http-server \
--description "Allow port 80 access to http-server"
list:
gcloud compute instances list
echo To see your application running, go to
echo http://IP_ADDRESS:8080 where IP_ADDRESS is the external address you
echo obtained above.
log:
sudo journalctl -u google-startup-scripts.service
# HANDY DANDIES:
# docker run -it gcr.io/eternal-sunset-206422/cw-proxy /bin/bash
# psql -h /tmp/cloudsql/eternal-sunset-206422:us-central1:master-proxy -U postgres
# sudo google_metadata_script_runner --script-type startup --debug
# git submodule add https://github.com/upstarter/crypto
# once pulled:
# git clone --recurse-submodules [email protected]:upstarter/cryptowise.git