|
14 | 14 | # See the License for the specific language governing permissions and
|
15 | 15 | # limitations under the License.
|
16 | 16 |
|
17 |
| -# set the key as GOOGLE_APPLICATION_CREDENTIALS |
18 |
| -export GOOGLE_APPLICATION_CREDENTIALS=~/key.json |
| 17 | +{ |
| 18 | + # set the key as GOOGLE_APPLICATION_CREDENTIALS |
| 19 | + export GOOGLE_APPLICATION_CREDENTIALS=~/key.json |
19 | 20 |
|
20 |
| -# Change the working directory |
21 |
| -cd ~/cloudshell_open/java-retail/samples/interactive-tutorials/ || exit |
| 21 | + # Change the working directory |
| 22 | + cd ~/cloudshell_open/java-retail/samples/interactive-tutorials/ || exit |
22 | 23 |
|
23 |
| -# Run the sample for creating the GCS bucket and extract the output of that execution |
24 |
| -output=$(mvn compile exec:java -Dexec.mainClass="product.setup.ProductsCreateGcsBucket") |
| 24 | + # Run the sample for creating the GCS bucket and extract the output of that execution |
| 25 | + output=$(mvn compile exec:java -Dexec.mainClass="product.setup.ProductsCreateGcsBucket") |
25 | 26 |
|
26 |
| -# Get the bucket name and store it in the env variable BUCKET_NAME |
27 |
| -temp="${output#*gcs bucket }" |
28 |
| -bucket_name="${temp% was created*}" |
29 |
| -export BUCKET_NAME=$bucket_name |
| 27 | + # Get the bucket name and store it in the env variable BUCKET_NAME |
| 28 | + temp="${output#*gcs bucket }" |
| 29 | + bucket_name="${temp% was created*}" |
| 30 | + export BUCKET_NAME=$bucket_name |
30 | 31 |
|
31 |
| -# Import products to the Retail catalog |
32 |
| -mvn compile exec:java -Dexec.mainClass="product.ImportProductsGcs" |
| 32 | + # Import products to the Retail catalog |
| 33 | + mvn compile exec:java -Dexec.mainClass="product.ImportProductsGcs" |
33 | 34 |
|
34 |
| -echo "=====================================" |
35 |
| -echo "Your Retail catalog is ready to use!" |
36 |
| -echo "=====================================" |
| 35 | +} && { |
| 36 | + |
| 37 | + # Print success message |
| 38 | + echo "=====================================" |
| 39 | + echo "Your Retail catalog is ready to use!" |
| 40 | + echo "=====================================" |
| 41 | + |
| 42 | + } || { |
| 43 | + |
| 44 | + # Print error message |
| 45 | + echo "=====================================" |
| 46 | + echo "Your Retail catalog wasn't created! Please fix the errors above!" |
| 47 | + echo "=====================================" |
| 48 | + |
| 49 | + } |
0 commit comments