Skip to content
Open
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
8 changes: 4 additions & 4 deletions scripts/prepare-testing-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ GCLOUD_PROJECT=$(gcloud config list project --format="value(core.project)" 2>/de
echo "Configuring project $GCLOUD_PROJECT for system tests."

echo "Creating cloud storage bucket."
gsutil mb gs://$GCLOUD_PROJECT
gsutil defacl set public-read gs://$GCLOUD_PROJECT
gcloud storage buckets create gs://$GCLOUD_PROJECT
gcloud storage buckets update gs://$GCLOUD_PROJECT --predefined-default-object-acl=public-read
Comment on lines +24 to +25
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For efficiency, you can combine these two commands into a single gcloud storage buckets create command by using the --predefined-default-object-acl flag during bucket creation. This reduces the number of API calls from two to one.

Suggested change
gcloud storage buckets create gs://$GCLOUD_PROJECT
gcloud storage buckets update gs://$GCLOUD_PROJECT --predefined-default-object-acl=public-read
gcloud storage buckets create gs://$GCLOUD_PROJECT --predefined-default-object-acl=public-read


echo "Creating bigtable resources."
gcloud alpha bigtable clusters create bigtable-test \
Expand All @@ -34,7 +34,7 @@ echo "Creating bigquery resources."
bq mk test_dataset
bq mk --schema bigquery/api/resources/schema.json test_dataset.test_import_table
bq mk ephemeral_test_dataset
gsutil cp bigquery/api/resources/data.csv gs://$GCLOUD_PROJECT/data.csv
gcloud storage cp bigquery/api/resources/data.csv gs://$GCLOUD_PROJECT/data.csv
bq load \
test_dataset.test_table \
gs://$GCLOUD_PROJECT/data.csv \
Expand All @@ -47,7 +47,7 @@ echo "Creating pubsub resources."
gcloud alpha pubsub topics create gae-mvm-pubsub-topic

echo "Creating speech resources."
gsutil cp speech/api-client/resources/audio.raw gs://$GCLOUD_PROJECT/speech/
gcloud storage cp speech/api-client/resources/audio.raw gs://$GCLOUD_PROJECT/speech/

echo "To finish setup, follow this link to enable APIs."
echo "https://console.cloud.google.com/flows/enableapi?project=${GCLOUD_PROJECT}&apiid=bigtable.googleapis.com,bigtableadmin.googleapis.com,bigquery,bigquerydatatransfer.googleapis.com,cloudmonitoring,compute_component,datastore,datastore.googleapis.com,dataproc,dns,plus,pubsub,logging,storage_api,texttospeech.googleapis.com,vision.googleapis.com"