-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: Migrate gsutil usage to gcloud storage #4493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,8 +28,8 @@ versionString="{\"latest\":\"$1\"}" | |||||||
| destination="gs://jib-versions/jib-gradle" | ||||||||
|
|
||||||||
| echo $versionString > jib-gradle | ||||||||
| gsutil cp jib-gradle $destination | ||||||||
| gsutil acl ch -u allUsers:READ $destination | ||||||||
| gcloud storage cp jib-gradle $destination | ||||||||
| gcloud storage objects update --add-acl-grant=allUsers:READ $destination | ||||||||
|
Comment on lines
+31
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better efficiency and atomicity, you can combine the copy and ACL update into a single command by using the
Suggested change
|
||||||||
| rm jib-gradle | ||||||||
|
|
||||||||
| gcsResult=$(curl https://storage.googleapis.com/jib-versions/jib-gradle) | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,8 +28,8 @@ versionString="{\"latest\":\"$1\"}" | |||||||
| destination="gs://jib-versions/jib-maven" | ||||||||
|
|
||||||||
| echo $versionString > jib-maven | ||||||||
| gsutil cp jib-maven $destination | ||||||||
| gsutil acl ch -u allUsers:READ $destination | ||||||||
| gcloud storage cp jib-maven $destination | ||||||||
| gcloud storage objects update --add-acl-grant=allUsers:READ $destination | ||||||||
|
Comment on lines
+31
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better efficiency and atomicity, you can combine the copy and ACL update into a single command by using the
Suggested change
|
||||||||
| rm jib-maven | ||||||||
|
|
||||||||
| gcsResult=$(curl https://storage.googleapis.com/jib-versions/jib-maven) | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better efficiency and atomicity, you can combine the copy and ACL update into a single command by using the
--predefined-acl=public-readflag. This avoids a second API call to update the object's ACLs after it has been uploaded.