Skip to content

Commit

Permalink
samples: bugfix-GRST-147-warn-user-about-fails-on-bucket-creation (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arakel2811 authored Jul 28, 2022
1 parent b63bd7a commit 6fcb5c4
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions retail/interactive-tutorials/user_import_data_to_catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@
# limitations under the License.

# set the key as GOOGLE_APPLICATION_CREDENTIALS
export GOOGLE_APPLICATION_CREDENTIALS=~/key.json
{
export GOOGLE_APPLICATION_CREDENTIALS=~/key.json

# Create a GCS bucket and upload the product data to the bucket
cd ~/cloudshell_open/nodejs-retail/samples
output=$(node ~/cloudshell_open/nodejs-retail/samples/interactive-tutorials/setup/create-gcs-bucket.js)
# Create a GCS bucket and upload the product data to the bucket
cd ~/cloudshell_open/nodejs-retail/samples
output=$(node ~/cloudshell_open/nodejs-retail/samples/interactive-tutorials/setup/create-gcs-bucket.js)

# Get the bucket name and store it in the env variable BUCKET_NAME
temp="${output#*Bucket }"
bucket_name="${temp% created*}"
export BUCKET_NAME=$bucket_name
# Get the bucket name and store it in the env variable BUCKET_NAME
temp="${output#*Bucket }"
bucket_name="${temp% created*}"
export BUCKET_NAME=$bucket_name

# Import products to the Retail catalog
node ~/cloudshell_open/nodejs-retail/samples/interactive-tutorials/product/import-products-gcs.js

echo "====================================="
echo "Your Retail catalog is ready to use!"
echo "====================================="
# Import products to the Retail catalog
node ~/cloudshell_open/nodejs-retail/samples/interactive-tutorials/product/import-products-gcs.js
} && {
echo "====================================="
echo "Your Retail catalog is ready to use!"
echo "====================================="
} || {
echo "================================================================"
echo "Your Retail catalog wasn't created! Please fix the errors above!"
echo "================================================================"
}

0 comments on commit 6fcb5c4

Please sign in to comment.