Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env sh
# author: Gary A. Stafford
# site: https://programmaticponderings.com
# license: MIT License
set -ex
# Set constants
PROJECT_ID="<your_project_id>"
REGION="<your_region>"
IMAGE_BUCKET="<your_bucket_name>"
# Create GCP Storage Bucket
gsutil mb \
-p ${PROJECT_ID} \
-c regional \
-l ${REGION} \
gs://${IMAGE_BUCKET}
# Upload images to bucket
for file in pics/image-*; do
gsutil cp ${file} gs://${IMAGE_BUCKET}
done
# Make all images public in bucket
gsutil iam ch allUsers:objectViewer gs://${IMAGE_BUCKET}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.