Skip to content

Commit

Permalink
feat(cdsctl): allow manual run a pipeline not launched (#5552)
Browse files Browse the repository at this point in the history
  • Loading branch information
yesnault authored Nov 20, 2020
1 parent a2503b5 commit 9069da2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cli/cdsctl/workflow_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var workflowRunManualCmd = cli.Command{
},
{
Name: "node-name",
Usage: "Node Name to relaunch; Flag run-number is mandatory",
Usage: "Node Name to launch; Flag run-number is mandatory",
},
{
Name: "interactive",
Expand Down Expand Up @@ -175,15 +175,16 @@ func workflowRunManualRun(v cli.Values) error {
if err != nil {
return err
}
for _, wnrs := range wr.WorkflowNodeRuns {
for _, wnr := range wnrs {
wn := wr.Workflow.WorkflowData.NodeByID(wnr.WorkflowNodeID)
if wn.Name == v.GetString("node-name") {
fromNodeID = wnr.WorkflowNodeID
break
}
for _, node := range wr.Workflow.WorkflowData.Array() {
if node.Name == v.GetString("node-name") {
fromNodeID = node.ID
break
}
}

if fromNodeID == 0 {
return fmt.Errorf("--node-name %v node found", v.GetString("node-name"))
}
}

w, err := client.WorkflowRunFromManual(v.GetString(_ProjectKey), v.GetString(_WorkflowName), manual, runNumber, fromNodeID)
Expand Down

0 comments on commit 9069da2

Please sign in to comment.