Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jib-cli/scripts/update_gcs_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ versionString="{\"latest\":\"$1\"}"
destination="gs://jib-versions/jib-cli"

echo $versionString > jib-cli-temp
gsutil cp jib-cli-temp $destination
gsutil acl ch -u allUsers:READ $destination
gcloud storage cp jib-cli-temp $destination
gcloud storage objects update --add-acl-grant=allUsers=READ $destination
Comment on lines +31 to +32
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better efficiency and atomicity, you can combine the copy and ACL update into a single command by using the --predefined-acl=public-read flag. This avoids a second API call to update the object's ACLs after it has been uploaded.

Suggested change
gcloud storage cp jib-cli-temp $destination
gcloud storage objects update --add-acl-grant=allUsers=READ $destination
gcloud storage cp --predefined-acl=public-read jib-cli-temp $destination

rm jib-cli-temp

gcsResult=$(curl https://storage.googleapis.com/jib-versions/jib-cli)
Expand Down
4 changes: 2 additions & 2 deletions jib-gradle-plugin/scripts/update_gcs_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better efficiency and atomicity, you can combine the copy and ACL update into a single command by using the --predefined-acl=public-read flag. This avoids a second API call to update the object's ACLs after it has been uploaded.

Suggested change
gcloud storage cp jib-gradle $destination
gcloud storage objects update --add-acl-grant=allUsers:READ $destination
gcloud storage cp --predefined-acl=public-read jib-gradle $destination

rm jib-gradle

gcsResult=$(curl https://storage.googleapis.com/jib-versions/jib-gradle)
Expand Down
4 changes: 2 additions & 2 deletions jib-maven-plugin/scripts/update_gcs_latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better efficiency and atomicity, you can combine the copy and ACL update into a single command by using the --predefined-acl=public-read flag. This avoids a second API call to update the object's ACLs after it has been uploaded.

Suggested change
gcloud storage cp jib-maven $destination
gcloud storage objects update --add-acl-grant=allUsers:READ $destination
gcloud storage cp --predefined-acl=public-read jib-maven $destination

rm jib-maven

gcsResult=$(curl https://storage.googleapis.com/jib-versions/jib-maven)
Expand Down
Loading