File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
memorystore/redis/gce_deployment Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616# [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"
2019 exit 1
21- fi
22- GCS_APP_LOCATION=" gs://$BUCKET /gce/"
23- echo $GCS_APP_LOCATION
2420fi
2521
2622if [ -z " $ZONE " ]; then
3733mvn clean package
3834
3935# 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/
4137
4238cd gce_deployment
4339
@@ -48,7 +44,7 @@ gcloud compute instances create my-instance \
4844 --machine-type=g1-small \
4945 --scopes cloud-platform \
5046 --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 \
5248 --zone $ZONE \
5349 --tags http-server
5450
Original file line number Diff line number Diff line change @@ -18,10 +18,10 @@ set -ex
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" )
2222WAR=$( curl -s " http://metadata.google.internal/computeMetadata/v1/instance/attributes/app-war" -H " Metadata-Flavor: Google" )
2323
24- gsutil cp " $GCS_APP_LOCATION " ** .
24+ gsutil cp gs:// " $GCS_BUCKET_NAME " /gce/ " $WAR " .
2525
2626# Install dependencies from apt
2727apt-get update
You can’t perform that action at this time.
0 commit comments