@@ -4,18 +4,21 @@ set -euo pipefail
44
55function cleanup() {
66 cd " $1 "
7+ local BUNDLE_UUID=" $2 "
78
89 # Replace specific names with company.databricks.com, user@company.com, user_name
910 find . -type f -exec sed -i ' ' -E ' s|e2[^[:space:]]*\.com|company.databricks.com|g' {} \;
1011 find . -type f -exec sed -i ' ' -E ' s|[A-Za-z0-9._%+-]+@databricks\.com|user@company.com|g' {} \;
11- find . -type f -exec sed -i ' ' -e " s|$CURRENT_USER_NAME |user_name|g" {} \;
12+ find . -type f -exec sed -i ' ' -e " s|$CURRENT_USER_NAME |user_name|g" {} \;
13+ find . -type f -exec sed -i ' ' -E " s|^([[:space:]]*uuid:[[:space:]]*)[^[:space:]]*[[:space:]]*$|\\ 1$BUNDLE_UUID |g" {} \;
1214
1315 cd ..
1416}
1517
1618function init_bundle() {
1719 local TEMPLATE_NAME=" $1 "
18- local CONFIG_JSON=" $2 "
20+ local BUNDLE_UUID=" ${2:- } "
21+ local CONFIG_JSON=" $3 "
1922
2023 # Extract project_name from JSON
2124 local PROJECT_NAME=$( echo " $CONFIG_JSON " | grep -o ' "project_name"[[:space:]]*:[[:space:]]*"[^"]*"' | cut -d' "' -f4)
@@ -32,7 +35,7 @@ function init_bundle() {
3235 rm -rf " $PROJECT_NAME "
3336 echo " $CONFIG_JSON " > /tmp/config.json
3437 $CLI_CMD bundle init " $TEMPLATE_NAME " --config-file /tmp/config.json
35- cleanup " $PROJECT_NAME "
38+ cleanup " $PROJECT_NAME " " $BUNDLE_UUID "
3639}
3740
3841# Check and extract the host from the databrickscfg file
6063
6164cd $( dirname $0 ) /..
6265
63- init_bundle " default-python" ' {
66+ init_bundle " default-python" " 87d5a23e-7bc7-4f52-98ee-e374b67d5681 " ' {
6467 "project_name": "default_python",
6568 "include_notebook": "yes",
6669 "include_dlt": "yes",
6770 "include_python": "yes",
6871 "serverless": "yes"
6972}'
7073
71- init_bundle " default-sql" ' {
74+ init_bundle " default-sql" " 853cd9bc-631c-4d4f-bca0-3195c7540854 " ' {
7275 "project_name": "default_sql",
7376 "http_path": "/sql/1.0/warehouses/abcdef1234567890",
7477 "default_catalog": "catalog",
7578 "personal_schemas": "yes, automatically use a schema based on the current user name during development"
7679}'
7780
78- init_bundle " dbt-sql" ' {
81+ init_bundle " dbt-sql" " 5e5ca8d5-0388-473e-84a1-1414ed89c5df " ' {
7982 "project_name": "dbt_sql",
8083 "http_path": "/sql/1.0/warehouses/abcdef1234567890",
8184 "default_catalog": "catalog",
8285 "personal_schemas": "yes, use a schema based on the current user name during development"
8386}'
8487
85- init_bundle " lakeflow-pipelines" ' {
88+ init_bundle " lakeflow-pipelines" " 295000fc-1ea8-4f43-befe-d5fb9f7d4ad4 " ' {
8689 "project_name": "lakeflow_pipelines_sql",
8790 "default_catalog": "catalog",
8891 "personal_schemas": "yes",
8992 "language": "sql"
9093}'
9194
9295
93- init_bundle " lakeflow-pipelines" ' {
96+ init_bundle " lakeflow-pipelines" " 87a174ba-60e4-4867-a140-1936bc9b00de " ' {
9497 "project_name": "lakeflow_pipelines_python",
9598 "default_catalog": "catalog",
9699 "personal_schemas": "yes",
@@ -99,7 +102,7 @@ init_bundle "lakeflow-pipelines" '{
99102
100103cd contrib
101104(
102- init_bundle " templates/data-engineering" ' {
105+ init_bundle " templates/data-engineering" " e5f6g7h8-i9j0-1234-efgh-567890123456 " ' {
103106 "project_name": "data_engineering",
104107 "default_catalog": "catalog",
105108 "personal_schemas": "yes, use a schema based on the current user name during development"
0 commit comments