Skip to content

Commit

Permalink
fix bmm rclone path
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikvedvik committed Nov 3, 2023
1 parent 9c68796 commit 1191811
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 6 additions & 1 deletion workflows/export/vx_export_bmm.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,14 @@ func VXExportToBMM(ctx workflow.Context, params VXExportChildWorkflowParams) (*V
return nil, fmt.Errorf("failed to write JSON file: %w", err)
}

outputPath, err := utils.ParsePath(outputFolder)
if err != nil {
return nil, err
}

ingestFolder := params.ExportData.SafeTitle + "_" + workflow.GetInfo(ctx).OriginalRunID
err = workflow.ExecuteActivity(ctx, activities.RcloneCopyDir, activities.RcloneCopyDirInput{
Source: strings.Replace(outputFolder, utils.GetIsilonPrefix()+"/", "isilon:isilon/", 1),
Source: outputPath.RclonePath(),
Destination: fmt.Sprintf("bmms3:/int-bmm-mediabanken/" + ingestFolder),
}).Get(ctx, nil)
if err != nil {
Expand Down
12 changes: 7 additions & 5 deletions workflows/export/vx_export_playout.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package export

import (
"path/filepath"
"strings"

"github.com/bcc-code/bccm-flows/activities"
"github.com/bcc-code/bccm-flows/common"
"github.com/bcc-code/bccm-flows/utils"
"github.com/bcc-code/bccm-flows/utils/wfutils"
"go.temporal.io/sdk/workflow"
"path/filepath"
)

func VXExportToPlayout(ctx workflow.Context, params VXExportChildWorkflowParams) (*VXExportResult, error) {
Expand Down Expand Up @@ -56,11 +54,15 @@ func VXExportToPlayout(ctx workflow.Context, params VXExportChildWorkflowParams)
options.TaskQueue = utils.GetWorkerQueue()
ctx = workflow.WithActivityOptions(ctx, options)

outputPath, err := utils.ParsePath(params.OutputDir)
if err != nil {
return nil, err
}

// Rclone to playout
source := strings.Replace(params.OutputDir, utils.GetIsilonPrefix()+"/", "isilon:isilon/", 1)
destination := "playout:/dropbox"
err = workflow.ExecuteActivity(ctx, activities.RcloneCopyDir, activities.RcloneCopyDirInput{
Source: source,
Source: outputPath.RclonePath(),
Destination: destination,
}).Get(ctx, nil)
if err != nil {
Expand Down

0 comments on commit 1191811

Please sign in to comment.