summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgurusai-voleti <gvoleti@google.com>2026-04-27 08:15:09 +0000
committergerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2026-05-14 21:31:49 -0700
commita94c9e2b521096ff961da1bc6daf97d74add121c (patch)
treebc17a531062493aee0c12d8bc549a137282f870d
parent51021fb209b118e6ff4350016657ce5f020b1bc2 (diff)
downloadgit-repo-a94c9e2b521096ff961da1bc6daf97d74add121c.tar.gz
Automated: Migrate gerrit/git-repo from gsutil to gcloud storage
Bug: 486536908 Change-Id: I248b093e189a3784b8959e837a5d66857f1ce0fc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/577201 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Guru sai rama subbarao Voleti (xWF) <gvoleti@google.com> Commit-Queue: Guru sai rama subbarao Voleti (xWF) <gvoleti@google.com>
-rw-r--r--fetch.py7
-rwxr-xr-xrelease/sign-launcher.py14
2 files changed, 11 insertions, 10 deletions
diff --git a/fetch.py b/fetch.py
index 55845af7e..509a0fcbd 100644
--- a/fetch.py
+++ b/fetch.py
@@ -34,7 +34,7 @@ def fetch_file(url, verbose=False):
34 """ 34 """
35 scheme = urlparse(url).scheme 35 scheme = urlparse(url).scheme
36 if scheme == "gs": 36 if scheme == "gs":
37 cmd = ["gsutil", "cat", url] 37 cmd = ["gcloud", "storage", "cat", url]
38 errors = [] 38 errors = []
39 try: 39 try:
40 result = subprocess.run( 40 result = subprocess.run(
@@ -42,7 +42,7 @@ def fetch_file(url, verbose=False):
42 ) 42 )
43 if result.stderr and verbose: 43 if result.stderr and verbose:
44 print( 44 print(
45 'warning: non-fatal error running "gsutil": %s' 45 'warning: non-fatal error running "gcloud storage": %s'
46 % result.stderr, 46 % result.stderr,
47 file=sys.stderr, 47 file=sys.stderr,
48 ) 48 )
@@ -50,7 +50,8 @@ def fetch_file(url, verbose=False):
50 except subprocess.CalledProcessError as e: 50 except subprocess.CalledProcessError as e:
51 errors.append(e) 51 errors.append(e)
52 print( 52 print(
53 'fatal: error running "gsutil": %s' % e.stderr, file=sys.stderr 53 'fatal: error running "gcloud storage": %s' % e.stderr,
54 file=sys.stderr,
54 ) 55 )
55 raise FetchFileError(aggregate_errors=errors) 56 raise FetchFileError(aggregate_errors=errors)
56 with urlopen(url) as f: 57 with urlopen(url) as f:
diff --git a/release/sign-launcher.py b/release/sign-launcher.py
index e19a6fcaa..274b06fb7 100755
--- a/release/sign-launcher.py
+++ b/release/sign-launcher.py
@@ -85,18 +85,18 @@ Repo launcher bucket:
85 gs://git-repo-downloads/ 85 gs://git-repo-downloads/
86 86
87You should first upload it with a specific version: 87You should first upload it with a specific version:
88 gsutil cp -a public-read {opts.launcher} gs://git-repo-downloads/repo-{version} 88 gcloud storage cp --predefined-acl=publicRead {opts.launcher} gs://git-repo-downloads/repo-{version}
89 gsutil cp -a public-read {opts.launcher}.asc gs://git-repo-downloads/repo-{version}.asc 89 gcloud storage cp --predefined-acl=publicRead {opts.launcher}.asc gs://git-repo-downloads/repo-{version}.asc
90 90
91Then to make it the public default: 91Then to make it the public default:
92 gsutil cp -a public-read gs://git-repo-downloads/repo-{version} gs://git-repo-downloads/repo 92 gcloud storage cp --predefined-acl=publicRead gs://git-repo-downloads/repo-{version} gs://git-repo-downloads/repo
93 gsutil cp -a public-read gs://git-repo-downloads/repo-{version}.asc gs://git-repo-downloads/repo.asc 93 gcloud storage cp --predefined-acl=publicRead gs://git-repo-downloads/repo-{version}.asc gs://git-repo-downloads/repo.asc
94 94
95NB: If a rollback is necessary, the GS bucket archives old versions, and may be 95NB: If a rollback is necessary, the GS bucket archives old versions, and may be
96 accessed by specifying their unique id number. 96 accessed by specifying their unique id number.
97 gsutil ls -la gs://git-repo-downloads/repo gs://git-repo-downloads/repo.asc 97 gcloud storage ls --long --all-versions gs://git-repo-downloads/repo gs://git-repo-downloads/repo.asc
98 gsutil cp -a public-read gs://git-repo-downloads/repo#<unique id> gs://git-repo-downloads/repo 98 gcloud storage cp --predefined-acl=publicRead gs://git-repo-downloads/repo#<unique id> gs://git-repo-downloads/repo
99 gsutil cp -a public-read gs://git-repo-downloads/repo.asc#<unique id> gs://git-repo-downloads/repo.asc 99 gcloud storage cp --predefined-acl=publicRead gs://git-repo-downloads/repo.asc#<unique id> gs://git-repo-downloads/repo.asc
100""" # noqa: E501 100""" # noqa: E501
101 ) 101 )
102 102