File tree 2 files changed +6
-10
lines changed
memorystore/redis/gce_deployment 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
# [START memorystore_deploy_sh]
17
- if [ -z " $GCS_APP_LOCATION " ]; then
18
- if [ -z " $BUCKET " ]; then
19
- echo " Must set \$ BUCKET. For example: BUCKET=my-bucket-name"
17
+ if [ -z " $GCS_BUCKET_NAME " ]; then
18
+ echo " Must set \$ GCS_BUCKET_NAME. For example: GCS_BUCKET_NAME=my-bucket"
20
19
exit 1
21
- fi
22
- GCS_APP_LOCATION=" gs://$BUCKET /gce/"
23
- echo $GCS_APP_LOCATION
24
20
fi
25
21
26
22
if [ -z " $ZONE " ]; then
37
33
mvn clean package
38
34
39
35
# Copy the WAR artifact to the GCS bucket location
40
- gsutil cp -r target/${WAR} ${GCS_APP_LOCATION}
36
+ gsutil cp -r target/${WAR} gs:// " $GCS_BUCKET_NAME " /gce/
41
37
42
38
cd gce_deployment
43
39
@@ -48,7 +44,7 @@ gcloud compute instances create my-instance \
48
44
--machine-type=g1-small \
49
45
--scopes cloud-platform \
50
46
--metadata-from-file startup-script=startup-script.sh \
51
- --metadata app-location= ${GCS_APP_LOCATION} ,app-war=$WAR \
47
+ --metadata gcs-bucket= $GCS_BUCKET_NAME ,app-war=$WAR \
52
48
--zone $ZONE \
53
49
--tags http-server
54
50
Original file line number Diff line number Diff line change @@ -18,10 +18,10 @@ set -ex
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
WAR=$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/app-war" -H " Metadata-Flavor: Google" )
23
23
24
- gsutil cp " $GCS_APP_LOCATION " ** .
24
+ gsutil cp gs:// " $GCS_BUCKET_NAME " /gce/ " $WAR " .
25
25
26
26
# Install dependencies from apt
27
27
apt-get update
You can’t perform that action at this time.
0 commit comments