File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -34,21 +34,33 @@ runs:
34
34
env :
35
35
TERM : linux
36
36
run : |
37
- set -x
37
+ set -e
38
38
(curl -Ls "https://dtsx.io/get-astra-cli" | bash) || true
39
- /home/runner/.astra/cli/astra db create -v "${{ inputs.db-name }}" \
39
+ ( /home/runner/.astra/cli/astra db create -v "${{ inputs.db-name }}" \
40
40
--env "${{ inputs.env }}" \
41
41
-k default_keyspace \
42
42
--token "${{ inputs.astra-token }}" \
43
43
--vector \
44
44
--region "${{ inputs.region }}" \
45
45
--cloud "${{ inputs.cloud }}" \
46
- --timeout 600
46
+ --timeout 1200) || "Failed to create database, check if creation is still in progress"
47
47
48
- describe_out=$(/home/runner/.astra/cli/astra db describe "${{ inputs.db-name }}" \
49
- --token "${{ inputs.astra-token }}" --env "${{ inputs.env }}" -o json)
48
+ while true; do
49
+ describe_out=$(/home/runner/.astra/cli/astra db describe "${{ inputs.db-name }}" \
50
+ --token "${{ inputs.astra-token }}" --env "${{ inputs.env }}" -o json)
51
+ status=$(echo "$describe_out" | jq -r '.data.status')
52
+ database_id=$(echo "$describe_out" | jq -r '.data.id')
53
+ if [ "$status" == "ACTIVE" ]; then
54
+ break
55
+ fi
56
+ if [ "$status" == "INITIALIZING" ]; then
57
+ echo "Database is not active, status: $status"
58
+ sleep 10
59
+ fi
60
+ echo "Database creation failed, status: $status"
61
+ exit 1
62
+ done
50
63
51
- database_id=$(echo "$describe_out" | jq -r '.data.id')
52
64
echo "Found database id: $database_id"
53
65
domain="astra"
54
66
if [ "${{ inputs.env }}" == "DEV" ]; then
Original file line number Diff line number Diff line change 70
70
- name : Setup AstraDB
71
71
uses : ./.github/actions/setup-astra-db
72
72
id : astra-db
73
+ timeout-minutes : 10
73
74
if : ${{ inputs.astradb }}
74
75
with :
75
76
astra-token : ${{ secrets[inputs.astradb-token-secret-name] }}
You can’t perform that action at this time.
0 commit comments