Skip to content

Commit 94fbe59

Browse files
committed
refactor(gsutil): Migrate gsutil to gcloud storage
1 parent e89c2d6 commit 94fbe59

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

kokoro/ubuntu/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set -o errexit
88

99

10-
gsutil -q cp "gs://ct4e-m2-repositories-for-kokoro/m2-cache.tar" - \
10+
gcloud storage cp "gs://ct4e-m2-repositories-for-kokoro/m2-cache.tar" - \
1111
| tar -C "${HOME}" -xf -
1212

1313
export CLOUDSDK_CORE_DISABLE_USAGE_REPORTING=true

kokoro/windows/continuous.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ java -version
1010

1111
rem To speed up build, download and unpack an M2 repo cache.
1212
pushd %USERPROFILE%
13-
call gsutil.cmd -q cp "gs://ct4e-m2-repositories-for-kokoro/m2-cache.tar" .
13+
call gcloud.cmd storage cp "gs://ct4e-m2-repositories-for-kokoro/m2-cache.tar" .
1414
@echo on
1515
tar xf m2-cache.tar && del m2-cache.tar
1616
popd

release/copy_repo_to_final_location.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ def _IsVersionString(string):
6363
def _GcsLocationExists(gcs_location):
6464
try:
6565
subprocess.check_output(
66-
["gsutil", "ls", gcs_location], stderr=subprocess.STDOUT)
66+
["gcloud", "storage", "ls", gcs_location], stderr=subprocess.STDOUT)
6767
return True
6868
except subprocess.CalledProcessError:
6969
return False
7070

7171

7272
def _GetCopyCommand(origin, destination):
73-
return ["gsutil", "-m", "cp", "-R", origin, destination]
73+
return ["gcloud", "storage", "cp", "--recursive", origin, destination]
7474

7575

7676
def _GetPublicAccessCommand(target):
77-
return ["gsutil", "-m", "acl", "ch", "-R", "-u", "AllUsers:R", target]
77+
return ["gcloud", "storage", "objects", "update", "--recursive", "--add-acl-grant=entity=AllUsers,role=READER", target]
7878

7979

8080
def main(argv):
@@ -89,7 +89,7 @@ def main(argv):
8989
print("# entered is correct, delete it first and try again.")
9090
print("#")
9191
print("# Command to delete:")
92-
print("# gsutil -m rm " + gcs_destination + "/**")
92+
print("# gcloud storage rm --recursive " + gcs_destination)
9393
exit(1)
9494

9595
# Copy the repo

release/copy_repo_to_final_location_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ def testGcsLocationExists_NonExistingLocation(self):
5555
_GcsLocationExists("gs://cloud-tools-for-eclipse/non-existing"))
5656

5757
def testGetCopyCommand(self):
58-
self.assertEquals(["gsutil", "-m", "cp", "-R", "origin", "destination"],
58+
self.assertEquals(["gcloud", "storage", "cp", "--recursive", "origin", "destination"],
5959
_GetCopyCommand("origin", "destination"))
6060

6161
def testGetPublicAccessCommand(self):
6262
self.assertEquals(
63-
["gsutil", "-m", "acl", "ch", "-R", "-u", "AllUsers:R", "target"],
63+
["gcloud", "storage", "objects", "update", "--recursive", "--add-acl-grant", "AllUsers:R", "target"],
6464
_GetPublicAccessCommand("target"))
6565

6666

0 commit comments

Comments
 (0)