File tree 2 files changed +6
-6
lines changed
memorystore/redis/gce_deployment
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
24
24
exit 1
25
25
fi
26
26
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"
29
29
exit 1
30
30
fi
31
31
37
37
# Upload the tar to GCS
38
38
tar -cvf app.tar -C .. requirements.txt main.py
39
39
# Copy to GCS bucket
40
- gsutil cp app.tar $GCS_APP_LOCATION
40
+ gsutil cp app.tar gs:// " $GCS_BUCKET_NAME " /gce/
41
41
42
42
# Create an instance
43
43
gcloud compute instances create my-instance \
@@ -46,7 +46,7 @@ gcloud compute instances create my-instance \
46
46
--machine-type=g1-small \
47
47
--scopes cloud-platform \
48
48
--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 \
50
50
--zone $ZONE \
51
51
--tags http-server
52
52
Original file line number Diff line number Diff line change 18
18
19
19
# Talk to the metadata server to get the project id and location of application binary.
20
20
PROJECTID=$( 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" )
22
22
REDISHOST=$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/redis-host" -H " Metadata-Flavor: Google" )
23
23
REDISPORT=$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/redis-port" -H " Metadata-Flavor: Google" )
24
24
@@ -33,7 +33,7 @@ apt-get install -yq \
33
33
curl -s " https://storage.googleapis.com/signals-agents/logging/google-fluentd-install.sh" | bash
34
34
service google-fluentd restart &
35
35
36
- gsutil cp " $GCS_APP_LOCATION " ** /
36
+ gsutil cp gs:// " $GCS_BUCKET_NAME " /gce/app.tar /app.tar
37
37
mkdir -p /app
38
38
tar -x -f /app.tar -C /app
39
39
cd /app
You can’t perform that action at this time.
0 commit comments