Commit 6f14799
Add scripts to DABs (#2813)
## Changes
Scripts can be defined in a bundle YAML file as:
```
scripts:
my_script:
content: |
echo "one"
echo "two"
```
They can then be run by calling `databricks bundle run my_script`
## Why
There are four primary benefits of having the scripts section in DABs:
1. Customers can scripts (like integration testing scripts) live and be
versioned with their bundle. Since integration tests based on spark
connect require authentication, scripts run via this mechanism will
automatically have the appropriate authentication configured.
2. Simplifies setup for users who might not have their own build tools
configured.
3. Allows us to stardarize documentation to always refer to the scripts
section.
4. Make DABs in the workspace integration possible. Since DABs in the
workspace cannot read arbitrary build file formats like Makefile.
### Why do we have an additional level of indentation with the `content`
field? Why not inline it?
The two main reasons are:
1. This mirrors what the artifacts block looks like. Users in the
artifact block are able to specify which shell they want to run their
build command in. We should offer the same functionality in the scripts
section.
5. Leaves the room open for us to provide users with additional
modifiers they might like to apply to their scripts.
## Tests
Acceptance tests.
---------
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>1 parent 2f1627d commit 6f14799
File tree
86 files changed
+920
-57
lines changed- acceptance/bundle
- debug
- direct
- tf
- run
- inline-script/cwd
- scripts
- basic
- cwd
- a/b/c
- scripts
- databricks-cli
- profile-is-passed/from_flag
- target-is-passed
- default
- from_flag
- exit_code
- io
- no-auth
- no-interpolation
- no_content
- shell
- envvar
- math
- unique_keys
- duplicate_resource_and_script_name_root
- duplicate_resource_and_script_subconfigurations
- duplicate_script_names_in_subconfiguration
- bundle
- config
- validate
- internal/schema
- phases
- schema
- tests
- cmd/bundle
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
86 files changed
+920
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Whitespace-only changes.
0 commit comments