Skip to content

Commit 52adfdb

Browse files
chore: Migrate gsutil usage to gcloud storage (#712)
1 parent ab381c1 commit 52adfdb

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

community/3-tier/cleanup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
deleteBucket() {
1313
local BUCKET_NAME=$PROJECT-$APP
1414
echo "Deleting bucket"
15-
gsutil rm -raf gs://${BUCKET_NAME}/*
16-
gsutil rb -f gs://${BUCKET_NAME}/
15+
gcloud storage rm --recursive --all-versions --continue-on-error gs://${BUCKET_NAME}/*
16+
gcloud storage buckets delete --continue-on-error gs://${BUCKET_NAME}/
1717
}
1818

1919
##

community/3-tier/deployCitiesMicroservices.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ echo ${BUCKET_NAME}
2828
echo_mesg "Deploying cities-service"
2929

3030
######### Copy Startup Script for cities-service
31-
gsutil cp -r startup-scripts/cities-service.sh gs://${BUCKET_NAME}/startup-scripts/cities-service.sh
31+
gcloud storage cp --recursive startup-scripts/cities-service.sh gs://${BUCKET_NAME}/startup-scripts/cities-service.sh
3232

3333
######### Create Instance Group for cities service
3434
createRegionalInstanceGroup cities-service ${APP_REGION} ${PROJECT} $NETWORK $SUBNET $BUCKET_NAME
@@ -49,7 +49,7 @@ deployCitiesUI() {
4949
echo_mesg "Deploying cities-ui"
5050

5151
######### Copy startup script for cities-ui
52-
gsutil cp -r startup-scripts/cities-ui.sh gs://${BUCKET_NAME}/startup-scripts/cities-ui.sh
52+
gcloud storage cp --recursive startup-scripts/cities-ui.sh gs://${BUCKET_NAME}/startup-scripts/cities-ui.sh
5353

5454
######### Create Instance Groups for cities ui
5555
createRegionalInstanceGroup cities-ui ${APP_REGION} ${PROJECT} $NETWORK $SUBNET $BUCKET_NAME
@@ -94,7 +94,7 @@ echo_mesg "****** Deploying Microservices *****"
9494

9595
######### Create Bucket
9696
echo_mesg "Creating Bucket"
97-
gsutil mb gs://${BUCKET_NAME}/
97+
gcloud storage buckets create gs://${BUCKET_NAME}/
9898

9999
######## Create VPC Network and subnetwork
100100
createVPCNetwork

community/lustre/scripts/startup-script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ EOF
175175
function hsm_import_bucket()
176176
{
177177

178-
bucket_file_list=`gsutil ls -r ${HSM_GCS_BUCKET_IMPORT}/** | sed "/\/:$/d"`
178+
bucket_file_list=`gcloud storage ls --recursive ${HSM_GCS_BUCKET_IMPORT}/** | sed "/\/:$/d"`
179179

180180
for i in $bucket_file_list
181181
do

tools/alt-testing/create-projects.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ gcloud iam service-accounts add-iam-policy-binding \
3636
cnrm-system@${KRM_PROJECT_ID}.iam.gserviceaccount.com \
3737
--member="serviceAccount:${KRM_PROJECT_ID}.svc.id.goog[cnrm-system/cnrm-controller-manager]" \
3838
--role="roles/iam.workloadIdentityUser"
39-
gsutil cp gs://cnrm/latest/release-bundle.tar.gz release-bundle.tar.gz
39+
gcloud storage cp gs://cnrm/latest/release-bundle.tar.gz release-bundle.tar.gz
4040
rm -rf release-bundle
4141
tar zxvf release-bundle.tar.gz
4242
sed -i.bak 's/${PROJECT_ID?}/'"$KRM_PROJECT_ID"'/' install-bundle-workload-identity/0-cnrm-system.yaml

tools/scheduled-deployments/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $ zip -jr ./functions scheduled-deployments.zip
6767
and upload that folder to Cloud Storage
6868

6969
```sh
70-
$ gsutil cp scheduled-deployments.zip gs://[PROJECT-ID].appspot.com
70+
$ gcloud storage cp scheduled-deployments.zip gs://[PROJECT-ID].appspot.com
7171
```
7272

7373
where `gs://[PROJECT-ID].appspot.com` is your Cloud Storage bucket name.
@@ -89,7 +89,7 @@ Cloud Storage. Make sure the file is set to be shared publicly. To upload to
8989
Cloud Storage, you can execute
9090

9191
```sh
92-
$ gsutil cp -a public-read openapi.json gs://[PROJECT-ID].appspot.com
92+
$ gcloud storage cp --predefined-acl=public-read openapi.json gs://[PROJECT-ID].appspot.com
9393
```
9494

9595
so your specification file will be available at

0 commit comments

Comments
 (0)