Skip to content

Commit 2c9f02e

Browse files
committed
pipeline: add transferLocationID config
1 parent e35e167 commit 2c9f02e

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

enduro.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ user = "test"
3737
key = "test"
3838
transferDir = "~/.am/ss-location-data"
3939
processingDir = ""
40+
# transferLocationID = "88f6b517-c0cc-411b-8abf-79544ce96f54"
4041

4142
[[hooks."hari"]]
4243
mock = true

internal/pipeline/pipeline.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import (
1818
// TODO: PipelineRegistry should return Pipeline objects!
1919

2020
type Config struct {
21-
Name string
22-
BaseURL string
23-
User string
24-
Key string
25-
TransferDir string
26-
ProcessingDir string
21+
Name string
22+
BaseURL string
23+
User string
24+
Key string
25+
TransferDir string
26+
TransferLocationID string
27+
ProcessingDir string
2728
}
2829

2930
// PipelineRegistry is a collection of known pipelines.

internal/workflow/processing.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,20 @@ func (a *TransferActivity) Execute(ctx context.Context, tinfo *TransferInfo) (*T
354354
return nil, err
355355
}
356356

357+
config, err := a.manager.Pipelines.Config(tinfo.Event.PipelineName)
358+
if err != nil {
359+
return nil, err
360+
}
361+
362+
// Transfer path should include the location UUID if defined.
363+
var path = tinfo.RelPath
364+
if config.TransferLocationID != "" {
365+
path = fmt.Sprintf("%s:%s", config.TransferLocationID, path)
366+
}
367+
357368
resp, httpResp, err := amc.Package.Create(ctx, &amclient.PackageCreateRequest{
358369
Name: tinfo.Name,
359-
Path: tinfo.RelPath,
370+
Path: path,
360371
ProcessingConfig: tinfo.ProcessingConfig,
361372
AutoApprove: &tinfo.AutoApprove,
362373
})

0 commit comments

Comments
 (0)