Skip to content
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

Use python instead of jq because Jenkins doesn't have jq #207

Merged
merged 1 commit into from
Nov 15, 2016
Merged
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
6 changes: 4 additions & 2 deletions lib/releaselib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,10 @@ release::gcs::ensure_release_bucket() {
logrun rm -f "$new_acl_file"
fi

if [[ $($GSUTIL defacl get "gs://$bucket" 2>/dev/null |\
jq -r '.[] | select(.entity == "allUsers") | .role') != 'READER' ]]; then
if [[ $($GSUTIL defacl get "gs://$bucket" 2>/dev/null | python -c '\
import sys,json;\
print " ".join(x["role"] for x in json.load(sys.stdin) if x["entity"] == "allUsers")')\
!= 'READER' ]]; then
logecho "GCS bucket $bucket is missing default public-read ACL."
logecho "Please add allUsers: READER to the gs://$bucket defacl and try again."
return 1
Expand Down