-
Notifications
You must be signed in to change notification settings - Fork 195
Expand file tree
/
Copy pathscript
More file actions
41 lines (34 loc) · 1.61 KB
/
Copy pathscript
File metadata and controls
41 lines (34 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
envsubst < databricks.yml.tmpl > databricks.yml
cleanup() {
trace $CLI bundle destroy --auto-approve
rm -f out.requests.txt
}
trap cleanup EXIT
title "Deploy with started=true: warehouse created and running"
trace errcode $CLI bundle deploy
WAREHOUSE_ID=$($CLI bundle summary -o json | jq -r '.resources.sql_warehouses.mywarehouse.id')
add_repl.py "$WAREHOUSE_ID" "WAREHOUSE_ID"
trace print_requests.py //sql/warehouses
rm -f out.requests.txt
{ trace errcode $CLI warehouses get "$WAREHOUSE_ID" | jq '.state'; } || true
title "Stop warehouse externally while config says started=true: plan detects drift"
{ trace errcode $CLI warehouses stop "$WAREHOUSE_ID" | jq '.state'; } || true
trace $CLI bundle plan
title "Deploy fixes the drift: warehouse restarted"
trace errcode $CLI bundle deploy
trace print_requests.py //sql/warehouses
rm -f out.requests.txt
{ trace errcode $CLI warehouses get "$WAREHOUSE_ID" | jq '.state'; } || true
title "Deploy with started=false while warehouse is stopped: warehouse stays stopped"
{ trace errcode $CLI warehouses stop "$WAREHOUSE_ID" | jq '.state'; } || true
trace update_file.py databricks.yml "started: true" "started: false"
trace errcode $CLI bundle deploy
trace print_requests.py //sql/warehouses
rm -f out.requests.txt
{ trace errcode $CLI warehouses get "$WAREHOUSE_ID" | jq '.state'; } || true
title "Deploy with started=true: warehouse restarted"
trace update_file.py databricks.yml "started: false" "started: true"
trace errcode $CLI bundle deploy
trace print_requests.py //sql/warehouses
rm -f out.requests.txt
{ trace errcode $CLI warehouses get "$WAREHOUSE_ID" | jq '.state'; } || true