2024-03-18 14:41:58 +00:00
|
|
|
package deploy
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/databricks/cli/bundle"
|
|
|
|
"github.com/databricks/cli/libs/filer"
|
|
|
|
)
|
|
|
|
|
|
|
|
// FilerFactory is a function that returns a filer.Filer.
|
|
|
|
type FilerFactory func(b *bundle.Bundle) (filer.Filer, error)
|
|
|
|
|
|
|
|
// StateFiler returns a filer.Filer that can be used to read/write state files.
|
|
|
|
func StateFiler(b *bundle.Bundle) (filer.Filer, error) {
|
|
|
|
return filer.NewWorkspaceFilesClient(b.WorkspaceClient(), b.Config.Workspace.StatePath)
|
|
|
|
}
|
2024-11-21 16:21:25 +00:00
|
|
|
|
|
|
|
// AppFiler returns a filer.Filer that can be used to read/write Databricks apps related files.
|
|
|
|
func AppFiler(b *bundle.Bundle) (filer.Filer, error) {
|
|
|
|
return filer.NewWorkspaceFilesClient(b.WorkspaceClient(), b.Config.Workspace.FilePath)
|
|
|
|
}
|