Skip to content

Commit 22c70ed

Browse files
Merge pull request #75 from databricks-industry-solutions/feat/deployment_update
Feat/deployment update
2 parents d95f83d + 3bc003c commit 22c70ed

File tree

4 files changed

+57
-5
lines changed

4 files changed

+57
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ dist/
145145
*.tmp
146146

147147
# Deployment temporary files
148+
databricks.yml
148149
databricks_final.yml
149150
databricks_final.yml.tmp
150151
#app/deploying_user.yml #cannot be ignored because asset bundles obey gitignore

databricks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include:
66
- resources/jobs/metagen.job.yml
77
- resources/jobs/sync_reviews.job.yml
88
# Uncomment the line below to deploy integration tests:
9-
#- resources/jobs/integration_tests.job.yml
9+
# - resources/jobs/integration_tests.job.yml
1010
- resources/apps/*.yml
1111
- benchmarks/resources/jobs/benchmarks/*.yml
1212
- variables.yml
@@ -24,15 +24,15 @@ targets:
2424
mode: development
2525
default: true
2626
workspace:
27-
host: <host url here>
27+
host: https://e2-demo-field-eng.cloud.databricks.com
2828
permissions:
2929
- user_name: ${var.deploying_user}
3030
level: CAN_MANAGE
3131

3232
prod:
3333
mode: production
3434
workspace:
35-
host: <host url here>
35+
host: https://e2-demo-field-eng.cloud.databricks.com
3636
root_path: ${var.current_working_directory}
3737
permissions:
3838
- user_name: ${var.current_user}

databricks.yml.template

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
bundle:
2+
name: dbxmetagen
3+
databricks_cli_version: ">=0.234.*"
4+
5+
include:
6+
- resources/jobs/metagen.job.yml
7+
- resources/jobs/sync_reviews.job.yml
8+
# Uncomment the line below to deploy integration tests:
9+
# - resources/jobs/integration_tests.job.yml
10+
- resources/apps/*.yml
11+
- benchmarks/resources/jobs/benchmarks/*.yml
12+
- variables.yml
13+
- variables.advanced.yml
14+
- resources/app_variables.yml
15+
16+
artifacts:
17+
default:
18+
type: whl
19+
build: poetry build
20+
path: .
21+
22+
targets:
23+
dev:
24+
mode: development
25+
default: true
26+
workspace:
27+
host: __DATABRICKS_HOST__
28+
permissions:
29+
- user_name: ${var.deploying_user}
30+
level: CAN_MANAGE
31+
32+
prod:
33+
mode: production
34+
workspace:
35+
host: __DATABRICKS_HOST__
36+
root_path: ${var.current_working_directory}
37+
permissions:
38+
- user_name: ${var.current_user}
39+
level: CAN_MANAGE
40+
run_as:
41+
user_name: ${var.current_user}
42+

deploy.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ if ! command -v databricks &> /dev/null; then
346346
exit 1
347347
fi
348348

349-
if [ ! -f "databricks.yml" ]; then
350-
echo "Error: databricks.yml not found. Run from the dbxmetagen directory."
349+
if [ ! -f "databricks.yml.template" ]; then
350+
echo "Error: databricks.yml.template not found. Run from the dbxmetagen directory."
351351
exit 1
352352
fi
353353

@@ -385,6 +385,15 @@ fi
385385
HOST_URL=$DATABRICKS_HOST
386386
TARGET=$TARGET
387387

388+
# Generate databricks.yml from template
389+
echo "Generating databricks.yml from template..."
390+
if [ ! -f "databricks.yml.template" ]; then
391+
echo "Error: databricks.yml.template not found"
392+
exit 1
393+
fi
394+
sed "s|__DATABRICKS_HOST__|${DATABRICKS_HOST}|g" databricks.yml.template > databricks.yml
395+
echo "Generated databricks.yml with host: ${DATABRICKS_HOST}"
396+
388397
if [ -f "variables.bkp" ]; then
389398
echo "Restoring variables.yml from backup..."
390399
mv variables.bkp variables.yml

0 commit comments

Comments
 (0)