Skip to content

Commit 6cea8a9

Browse files
committed
refactor: replace legacy gsutil calls with gcloud
1 parent 5e7e0f9 commit 6cea8a9

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

memorystore/redis/gce_deployment/deploy.sh

100644100755
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ GOOS=linux GOARCH=amd64 go build -v -o app ../main.go
2727
# Add the app binary
2828
tar -cvf app.tar app
2929
# Copy to GCS bucket
30-
gsutil cp app.tar gs://"$GCS_BUCKET_NAME"/gce/
30+
gcloud storage cp -q app.tar gs://"$GCS_BUCKET_NAME"/gce/
3131

3232
# Create an instance
3333
gcloud compute instances create my-instance \
34-
--image-family=debian-9 \
34+
--image-family=debian-11 \
3535
--image-project=debian-cloud \
36-
--machine-type=g1-small \
36+
--machine-type=e2-small \
3737
--scopes cloud-platform \
3838
--metadata-from-file startup-script=startup-script.sh \
3939
--metadata gcs-bucket="$GCS_BUCKET_NAME",redis-host="$REDISHOST",redis-port="$REDISPORT" \

memorystore/redis/gce_deployment/startup-script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fi
2424
chmod +x google-fluentd-install.sh && ./google-fluentd-install.sh
2525
service google-fluentd restart &
2626

27-
gsutil cp gs://"$GCS_BUCKET_NAME"/gce/app.tar /app.tar
27+
gcloud storage cp -q gs://"$GCS_BUCKET_NAME"/gce/app.tar /app.tar
2828
mkdir -p /app
2929
tar -x -f /app.tar -C /app
3030
chmod +x /app/app

testing/cloudbuild/cloudbuild.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ steps:
2323
- REPORT_REPO=golang-samples
2424

2525
# Get the credentials for integration tests.
26-
- name: gcr.io/cloud-builders/gsutil
27-
args: ['cp', 'gs://golang-samples-secrets/golang-samples-tests-4fbf85dd0f24.json', 'key.json']
26+
- name: gcr.io/google.com/cloudsdktool/google-cloud-cli
27+
entrypoint: gcloud
28+
args: ['storage', 'cp', 'gs://golang-samples-secrets/golang-samples-tests-4fbf85dd0f24.json', 'key.json']
2829

2930
# Run the tests
3031
- name: gcr.io/$PROJECT_ID/go19

testing/gimmeproj/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ cross:
1414
GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o bin/windows_amd64/gimmeproj.exe
1515

1616
upload: cross
17-
gsutil -m cp -a public-read -r bin/* gs://gimme-proj/
17+
gcloud storage cp -q -r bin/* gs://gimme-proj/ --predefined-acl=public-read

0 commit comments

Comments
 (0)