Skip to content

Commit 5cd261b

Browse files
authored
(fix): update deploy.sh script (GoogleCloudPlatform#281)
Update debian image. Fix some options that are deprecated. Use a larger instance. This is needed for the startup script to work. Fixes GoogleCloudPlatform#280
1 parent 9b47e91 commit 5cd261b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

7-gce/gce/deploy.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ ZONE=us-central1-f
1919

2020
GROUP=frontend-group
2121
TEMPLATE=$GROUP-tmpl
22-
MACHINE_TYPE=f1-micro
23-
IMAGE=debian-8
22+
MACHINE_TYPE=g1-small
23+
IMAGE=debian-9
2424
STARTUP_SCRIPT=startup-script.sh
2525
SCOPES="userinfo-email,cloud-platform"
2626
TAGS=http-server
@@ -41,7 +41,8 @@ SERVICE=frontend-web-service
4141

4242
# [START create_template]
4343
gcloud compute instance-templates create $TEMPLATE \
44-
--image $IMAGE \
44+
--image-family $IMAGE \
45+
--image-project=debian-cloud \
4546
--machine-type $MACHINE_TYPE \
4647
--scopes $SCOPES \
4748
--metadata-from-file startup-script=$STARTUP_SCRIPT \
@@ -98,13 +99,15 @@ gcloud compute http-health-checks create ah-health-check \
9899
# [START create_backend_service]
99100
gcloud compute backend-services create $SERVICE \
100101
--http-health-checks ah-health-check \
101-
--port 8080
102+
--port-name http \
103+
--global
102104
# [END create_backend_service]
103105

104106
# [START add_backend_service]
105107
gcloud compute backend-services add-backend $SERVICE \
106108
--instance-group $GROUP \
107-
--zone $ZONE
109+
--instance-group-zone $ZONE \
110+
--global
108111
# [END add_backend_service]
109112

110113
# Create a URL map and web Proxy. The URL map will send all requests to the
@@ -126,7 +129,7 @@ gcloud compute target-http-proxies create $SERVICE-proxy \
126129
gcloud compute forwarding-rules create $SERVICE-http-rule \
127130
--global \
128131
--target-http-proxy $SERVICE-proxy \
129-
--port-range 80
132+
--ports 80
130133
# [END create_forwarding_rule]
131134

132135
#

7-gce/gce/teardown.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ gcloud compute target-http-proxies delete $SERVICE-proxy
3030

3131
gcloud compute url-maps delete $SERVICE-map
3232

33-
gcloud compute backend-services delete $SERVICE
33+
gcloud compute backend-services delete $SERVICE --global
3434

3535
gcloud compute http-health-checks delete ah-health-check
3636

0 commit comments

Comments
 (0)