|
8 | 8 |
|
9 | 9 | # Create Object Store Bucket (Should be replaced by terraform one day) |
10 | 10 | while ! state_done OBJECT_STORE_BUCKET; do |
11 | | - echo "creating object storage bucket" |
12 | | - oci os bucket create --compartment-id "$(state_get COMPARTMENT_OCID)" --name "$(state_get RUN_NAME)" |
13 | | - state_set_done OBJECT_STORE_BUCKET |
14 | | - echo "finished creating object storage buckets" |
| 11 | + echo "Checking object storage bucket" |
| 12 | +# oci os bucket create --compartment-id "$(state_get COMPARTMENT_OCID)" --name "$(state_get RUN_NAME)" |
| 13 | + if oci os bucket get --name "$(state_get RUN_NAME)-$(state_get MTDR_KEY)"; then |
| 14 | + state_set_done OBJECT_STORE_BUCKET |
| 15 | + echo "finished checking object storage bucket" |
| 16 | + fi |
15 | 17 | done |
16 | 18 |
|
17 | 19 |
|
|
40 | 42 | while ! state_done CWALLET_SSO_OBJECT; do |
41 | 43 | echo "grabbing wallet" |
42 | 44 | cd $MTDRWORKSHOP_LOCATION/wallet |
43 | | - oci os object put --bucket-name "$(state_get RUN_NAME)" --name "cwallet.sso" --file 'cwallet.sso' |
| 45 | + oci os object put --bucket-name "$(state_get RUN_NAME)-$(state_get MTDR_KEY)" --name "cwallet.sso" --file 'cwallet.sso' |
44 | 46 | cd $MTDRWORKSHOP_LOCATION |
45 | 47 | state_set_done CWALLET_SSO_OBJECT |
46 | 48 | echo "done grabbing wallet" |
|
50 | 52 | # Create Authenticated Link to Wallet |
51 | 53 | while ! state_done CWALLET_SSO_AUTH_URL; do |
52 | 54 | echo "creating authenticated link to wallet" |
53 | | - ACCESS_URI=`oci os preauth-request create --object-name 'cwallet.sso' --access-type 'ObjectRead' --bucket-name "$(state_get RUN_NAME)" --name 'mtdrworkshop' --time-expires $(date '+%Y-%m-%d' --date '+7 days') --query 'data."access-uri"' --raw-output` |
| 55 | + ACCESS_URI=`oci os preauth-request create --object-name 'cwallet.sso' --access-type 'ObjectRead' --bucket-name "$(state_get RUN_NAME)-$(state_get MTDR_KEY)" --name 'mtdrworkshop' --time-expires $(date '+%Y-%m-%d' --date '+7 days') --query 'data."access-uri"' --raw-output` |
54 | 56 | state_set CWALLET_SSO_AUTH_URL "https://objectstorage.$(state_get REGION).oraclecloud.com${ACCESS_URI}" |
55 | 57 | echo "done creating authenticated link to wallet" |
56 | 58 | done |
|
0 commit comments