2023-02-20 18:42:55 +00:00
|
|
|
package files
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/databricks/bricks/bundle"
|
|
|
|
)
|
|
|
|
|
|
|
|
type upload struct{}
|
|
|
|
|
|
|
|
func (m *upload) Name() string {
|
|
|
|
return "files.Upload"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *upload) Apply(ctx context.Context, b *bundle.Bundle) ([]bundle.Mutator, error) {
|
2023-04-11 14:57:01 +00:00
|
|
|
sync, err := getSync(ctx, b)
|
2023-02-20 18:42:55 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = sync.RunOnce(ctx)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func Upload() bundle.Mutator {
|
|
|
|
return &upload{}
|
|
|
|
}
|