Skip to content

Commit

Permalink
Use python instead of jq because Jenkins doesn't have jq
Browse files Browse the repository at this point in the history
  • Loading branch information
ixdy committed Nov 15, 2016
1 parent 1eefed4 commit 7a3a036
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 7a3a036

Please sign in to comment.