databricks-cli/bundle/libraries/filer_workspace.go

20 lines
626 B
Go
Raw Normal View History

2024-10-15 13:22:41 +00:00
package libraries
import (
"path"
"github.com/databricks/cli/bundle"
"github.com/databricks/cli/libs/diag"
"github.com/databricks/cli/libs/filer"
)
2024-11-29 18:49:07 +00:00
// We upload artifacts to the workspace in a directory named ".internal" to have
// a well defined location for artifacts that have been uploaded by the DABs.
const InternalDirName = ".internal"
2024-10-15 13:22:41 +00:00
func filerForWorkspace(b *bundle.Bundle) (filer.Filer, string, diag.Diagnostics) {
2024-11-29 18:49:07 +00:00
uploadPath := path.Join(b.Config.Workspace.ArtifactPath, InternalDirName)
2024-10-15 13:22:41 +00:00
f, err := filer.NewWorkspaceFilesClient(b.WorkspaceClient(), uploadPath)
return f, uploadPath, diag.FromErr(err)
}