Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c50efe7
Cherry-picked "Update README"
tetiana-karasova Mar 22, 2022
f643f83
Cherry-picked "the bash scripts are added"
t-karasova Mar 31, 2022
62f947d
Cherry-picked "Updated README"
t-karasova Apr 1, 2022
aa1ce1d
Update user_environment_setup.sh
t-karasova Apr 1, 2022
5ec159a
Update user_import_data_to_catalog.sh
t-karasova Apr 1, 2022
b308d9b
Cherry-picked "Updated README"
t-karasova Apr 5, 2022
2c90e8e
Refactoring product package (Import).
sborisenkox Apr 25, 2022
f0f490d
Remove init package.
sborisenkox Apr 25, 2022
fcb2411
Update README
dfirova Jul 1, 2022
eba6357
Removed assuredBreak.
dfirova Jul 14, 2022
c215629
PR fix: removed tests for setup/cleanup.
dfirova Jul 18, 2022
f6ad617
PR fix: fixed the deadline.
dfirova Jul 20, 2022
6274346
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Jul 27, 2022
dab57ce
PR fix: unique bucket name.
dfirova Aug 9, 2022
893e576
PR fix: unique bucket name.
dfirova Aug 9, 2022
5069936
PR fix: removed test.
dfirova Aug 9, 2022
f394e08
Merge branch 'main' into refactoring-products-import
dfirova Aug 11, 2022
24ab126
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Aug 11, 2022
61bcab2
Merge branch 'main' into refactoring-products-import
dfirova Aug 12, 2022
e7cdbb8
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Aug 12, 2022
fe0dcdf
Merge branch 'main' into refactoring-products-import
dfirova Aug 19, 2022
ca8ebda
Merge branch 'googleapis:main' into refactoring-products-import
dfirova Aug 25, 2022
9a7c57b
Merge branch 'main' into refactoring-products-import
dfirova Aug 25, 2022
10b8271
Merge remote-tracking branch 'origin/refactoring-products-import' int…
dfirova Aug 25, 2022
8b8b2b2
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Aug 26, 2022
135e0a7
PR fix: changed tests to be similar to events test.
dfirova Aug 31, 2022
7da8114
Merge remote-tracking branch 'origin/refactoring-products-import' int…
dfirova Aug 31, 2022
2ddf274
PR fix: returned test to previous state.
dfirova Sep 1, 2022
9ff7076
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Sep 8, 2022
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
Prev Previous commit
Next Next commit
Cherry-picked "the bash scripts are added"
  • Loading branch information
t-karasova authored and dfirova committed Jul 1, 2022
commit f643f83bace147307fe2a682ea3094e87aa05ffd
32 changes: 16 additions & 16 deletions samples/interactive-tutorials/user_environment_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,40 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# set the Google Cloud Project ID
# set the Google Cloud project Id
project_id=$1
echo "Project ID: $project_id"
gcloud config set project "$project_id"
echo Project ID: $project_id
gcloud config set project project_id

timestamp=$(date +%s)

service_account_id="service-acc-$timestamp"
echo "Service Account: $service_account_id"
service_account_id="service-acc-"$timestamp
echo Service Account: $service_account_id

# create service account (your service-acc-$timestamp)
gcloud iam service-accounts create "$service_account_id"
# create service account (your project_id+timestamp)
gcloud iam service-accounts create $service_account_id

# assign necessary roles to your new service account
# assign needed roles to your new service account
for role in {retail.admin,editor,bigquery.admin}
do
gcloud projects add-iam-policy-binding "$project_id" --member="serviceAccount:$service_account_id@$project_id.iam.gserviceaccount.com" --role=roles/"${role}"
gcloud projects add-iam-policy-binding $project_id --member="serviceAccount:"$service_account_id"@"$project_id".iam.gserviceaccount.com" --role="roles/${role}"
done

echo "Wait ~60 seconds to be sure the appropriate roles have been assigned to your service account"
sleep 60
echo Wait 70 seconds to be sure the appropriate roles have been assigned to your service account
sleep 70

# upload your service account key file
service_acc_email="$service_account_id@$project_id.iam.gserviceaccount.com"
gcloud iam service-accounts keys create ~/key.json --iam-account "$service_acc_email"
service_acc_email=$service_account_id"@"$project_id".iam.gserviceaccount.com"
gcloud iam service-accounts keys create ~/key.json --iam-account $service_acc_email

# activate the service account using the key
gcloud auth activate-service-account --key-file ~/key.json

# install needed Google client libraries
cd ~/cloudshell_open/java-retail/samples/interactive-tutorials || exit
cd ~/cloudshell_open/java-retail/samples/interactive-tutorials
mvn clean install -DskipTests

echo "========================================"
echo ========================================
echo "The Google Cloud setup is completed."
echo "Please proceed with the Tutorial steps"
echo "========================================"
echo ========================================
8 changes: 4 additions & 4 deletions samples/interactive-tutorials/user_import_data_to_catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
export GOOGLE_APPLICATION_CREDENTIALS=~/key.json

# Change the working directory
cd ~/cloudshell_open/java-retail/samples/interactive-tutorials/ || exit
cd ~/cloudshell_open/java-retail/samples/interactive-tutorials/

# Run the sample for creating the GCS bucket and extract the output of that execution
# Create a GCS bucket and upload the product data to the bucket
output=$(mvn compile exec:java -Dexec.mainClass="product.setup.ProductsCreateGcsBucket")

# Get the bucket name and store it in the env variable BUCKET_NAME
Expand All @@ -31,6 +31,6 @@ export BUCKET_NAME=$bucket_name
# Import products to the Retail catalog
mvn compile exec:java -Dexec.mainClass="product.ImportProductsGcs"

echo "====================================="
echo =====================================
echo "Your Retail catalog is ready to use!"
echo "====================================="
echo =====================================