Carry dependencies through pipeline commands
This commit is contained in:
@@ -12,10 +12,15 @@ import (
|
||||
|
||||
// Run executes the pipeline plan and persists manifest state.
|
||||
func Run(ctx context.Context, args []string, out io.Writer) error {
|
||||
return runWithPipelineExecutor(ctx, args, out, executePlan)
|
||||
return runWithDependencies(ctx, args, out, executePlan, commandDependencies{})
|
||||
}
|
||||
|
||||
func runWithPipelineExecutor(ctx context.Context, args []string, out io.Writer, executor pipelineExecutor) error {
|
||||
return runWithDependencies(ctx, args, out, executor, commandDependencies{})
|
||||
}
|
||||
|
||||
func runWithDependencies(ctx context.Context, args []string, out io.Writer, executor pipelineExecutor, deps commandDependencies) error {
|
||||
deps = normalizeCommandDependencies(deps)
|
||||
request, err := parseBoundedRunRequest("run", args, out)
|
||||
if err != nil {
|
||||
if errors.Is(err, flag.ErrHelp) {
|
||||
@@ -24,7 +29,7 @@ func runWithPipelineExecutor(ctx context.Context, args []string, out io.Writer,
|
||||
return err
|
||||
}
|
||||
flags := request.Config
|
||||
loaded, err := loadCommandConfig(ctx, flags.pipelinePath, flags.campaignPath, flags.campaignFilePath, flags.sessionPath, flags.sessionOptions())
|
||||
loaded, err := loadCommandConfigWithDependencies(ctx, flags.pipelinePath, flags.campaignPath, flags.campaignFilePath, flags.sessionPath, flags.sessionOptions(), deps)
|
||||
if err != nil {
|
||||
return fmt.Errorf("run: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user