Skip to content

(fix): update deploy.sh script #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions 7-gce/gce/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ZONE=us-central1-f

GROUP=frontend-group
TEMPLATE=$GROUP-tmpl
MACHINE_TYPE=f1-micro
IMAGE=debian-8
MACHINE_TYPE=g1-small
IMAGE=debian-9
STARTUP_SCRIPT=startup-script.sh
SCOPES="userinfo-email,cloud-platform"
TAGS=http-server
Expand All @@ -41,7 +41,8 @@ SERVICE=frontend-web-service

# [START create_template]
gcloud compute instance-templates create $TEMPLATE \
--image $IMAGE \
--image-family $IMAGE \
--image-project=debian-cloud \
--machine-type $MACHINE_TYPE \
--scopes $SCOPES \
--metadata-from-file startup-script=$STARTUP_SCRIPT \
Expand Down Expand Up @@ -98,13 +99,15 @@ gcloud compute http-health-checks create ah-health-check \
# [START create_backend_service]
gcloud compute backend-services create $SERVICE \
--http-health-checks ah-health-check \
--port 8080
--port-name http \
--global
# [END create_backend_service]

# [START add_backend_service]
gcloud compute backend-services add-backend $SERVICE \
--instance-group $GROUP \
--zone $ZONE
--instance-group-zone $ZONE \
--global
# [END add_backend_service]

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

#
Expand Down
2 changes: 1 addition & 1 deletion 7-gce/gce/teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ gcloud compute target-http-proxies delete $SERVICE-proxy

gcloud compute url-maps delete $SERVICE-map

gcloud compute backend-services delete $SERVICE
gcloud compute backend-services delete $SERVICE --global

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

Expand Down