Skip to content
Open
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
4 changes: 2 additions & 2 deletions gce/makeProject
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function print_usage() {
echo "deploying the hello-world app. You may add all your configuration here, so you don't need"
echo "to change them in every version of this application."
echo ""
echo "gce - mvn package; gsutil cp; gcloud compute instances create ...; - deploys to Compute Engine"
echo "gce - mvn package; gcloud storage cp; gcloud compute instances create ...; - deploys to Compute Engine"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This help message reflects the gcloud storage cp step. As noted in my other comment, this step appears to be redundant because the startup script does not use the uploaded artifacts. This help text should be updated to reflect the actual deployment process, which might mean removing the gcloud storage cp mention if that step is removed.

echo "down - tears down a single instance group"
echo "gce-many - deploys a managed instance group"
echo "down-many- tears down a managed instance group"
Expand Down Expand Up @@ -81,7 +81,7 @@ gce)
# [START getting_started_gce_single]
mvn clean package

gsutil cp -r target/${WAR} config/base gs://${BUCKET}/gce/
gcloud storage cp --recursive target/${WAR} config/base gs://${BUCKET}/gce/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This command uploads build artifacts to a GCS bucket, but the startup script (scripts/startup-script.sh) used for the GCE instance does not use these artifacts. Instead, it clones the source code from GitHub and builds the project from scratch on the instance. This makes the upload step unnecessary and the deployment process inefficient.

I recommend one of the following fixes:

  1. Remove this gcloud storage cp command and related BUCKET logic if building on the instance is the desired behavior.
  2. (Preferred) Modify scripts/startup-script.sh to download the pre-built artifacts from the GCS bucket. This would significantly speed up instance startup and remove the need to install git and maven on the production instance.


gcloud compute firewall-rules create allow-http-hello-world \
--allow tcp:80 \
Expand Down