File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
memorystore/redis/gce_deployment Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ if [ -z "$REDISPORT" ]; then
2424 exit 1
2525fi
2626
27- if [ -z " $GCS_APP_LOCATION " ]; then
28- echo " Must set \$ GCS_APP_LOCATION . For example: GCS_APP_LOCATION=gs:// my-bucket/app "
27+ if [ -z " $GCS_BUCKET_NAME " ]; then
28+ echo " Must set \$ GCS_BUCKET_NAME . For example: GCS_BUCKET_NAME= my-bucket"
2929 exit 1
3030fi
3131
3737# Upload the tar to GCS
3838tar -cvf app.tar -C .. requirements.txt main.py
3939# Copy to GCS bucket
40- gsutil cp app.tar $GCS_APP_LOCATION
40+ gsutil cp app.tar gs:// " $GCS_BUCKET_NAME " /gce/
4141
4242# Create an instance
4343gcloud compute instances create my-instance \
@@ -46,7 +46,7 @@ gcloud compute instances create my-instance \
4646 --machine-type=g1-small \
4747 --scopes cloud-platform \
4848 --metadata-from-file startup-script=startup-script.sh \
49- --metadata app-location= $GCS_APP_LOCATION ,redis-host=$REDISHOST ,redis-port=$REDISPORT \
49+ --metadata gcs-bucket= $GCS_BUCKET_NAME ,redis-host=$REDISHOST ,redis-port=$REDISPORT \
5050 --zone $ZONE \
5151 --tags http-server
5252
Original file line number Diff line number Diff line change 1818
1919# Talk to the metadata server to get the project id and location of application binary.
2020PROJECTID=$( curl -s " http://metadata.google.internal/computeMetadata/v1/project/project-id" -H " Metadata-Flavor: Google" )
21- GCS_APP_LOCATION =$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/app-location " -H " Metadata-Flavor: Google" )
21+ GCS_BUCKET_NAME =$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/gcs-bucket " -H " Metadata-Flavor: Google" )
2222REDISHOST=$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/redis-host" -H " Metadata-Flavor: Google" )
2323REDISPORT=$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/redis-port" -H " Metadata-Flavor: Google" )
2424
@@ -33,7 +33,7 @@ apt-get install -yq \
3333curl -s " https://storage.googleapis.com/signals-agents/logging/google-fluentd-install.sh" | bash
3434service google-fluentd restart &
3535
36- gsutil cp " $GCS_APP_LOCATION " ** /
36+ gsutil cp gs:// " $GCS_BUCKET_NAME " /gce/app.tar /app.tar
3737mkdir -p /app
3838tar -x -f /app.tar -C /app
3939cd /app
You can’t perform that action at this time.
0 commit comments