This script uploads all files in a given directory to a GCP bucket. It doesn't go through subdirectories!
- From GCP's Admin, get a service account with Storage Object Creator role. Be aware that this doesn't grant permissions for viewing, editing or deleting/overwriting.
- Get a
keys.json
file from the GCP service account and place it in this dir. - Replace the configuration constants with proper values:
BUCKET_NAME
: Destination GCP bucket name.BUCKET_DESTINATION_FOLDER
: Destination folder name.FOLDER_TO_UPLOAD
: Absolute path of folder that contains files to upload.
yarn install
.yarn upload_gcp
.