use pause

Showcase you can use pause during the execution of the task steps

Pause and inspect for debugging

It is good that we can have an option to pause the workflow and inspect the runtime values to understand what is not working. You will be prompted with option to continue, to quit or inspect the runtime vars

Note that pause support generic step rather than just shell func, it works for cmd func too in this demo

Enter Value For pause action to continue:

enter: continue
    q: quit
    i: inspect

Demo

source

Main task yaml file
    vars:
      a: global-var-a
    tasks:
    - name: task
      task:
      - func: shell
        vars:
          b: runtime-var-b
        do:
        - echo "hello"
        - echo "hello {{.a}}"
        flags: [pause]
      - func: cmd
        vars:
          b: runtime-var-b
        do:
        - name: print
          cmd: "hello {{.a}}"
        flags: [pause]
      - func: shell
        do:
        - echo "next step"
    
Main log file
    loading [Config]:  ./tests/functests/upconfig.yml
    Main config:
                 Version -> 1.0.0
                  RefDir -> ./tests/functests
                 WorkDir -> cwd
              AbsWorkDir -> /up_project/up
                TaskFile -> c0063
                 Verbose -> vvv
              ModuleName -> self
               ShellType -> /bin/sh
           MaxCallLayers -> 8
                 Timeout -> 3600000
     MaxModuelCallLayers -> 256
               EntryTask -> task
      ModRepoUsernameRef -> 
      ModRepoPasswordRef -> 
    work dir: /up_project/up
    -exec task: task
    loading [Task]:  ./tests/functests/c0063
    module: [self], instance id: [dev], exec profile: []
    profile -  envVars:
    
    (*core.Cache)({
    })
    
    Task1: [task ==> task:  ]
    -Step1:
    self: final context exec vars:
    
    (*core.Cache)({
      "a": "global-var-a",
      "up_runtime_task_layer_number": 0,
      "b": "runtime-var-b"
    })
    
    Enter Value For [pause action to continue]: 
    
    enter: continue 
        q: quit
        i: inspect
    
    cmd( 1):
    echo "hello"
    
    -
    hello
    
    -
     .. ok
    cmd( 2):
    echo "hello {{.a}}"
    
    -
    hello global-var-a
    
    -
     .. ok
    . ok
    -Step2:
    self: final context exec vars:
    
    (*core.Cache)({
      "b": "runtime-var-b",
      "last_result": (*utils.ExecResult)({
        Cmd: "echo \"hello global-var-a\"",
        Code: 0,
        Output: "hello global-var-a",
        ErrMsg: ""
      }),
      "a": "global-var-a",
      "up_runtime_task_layer_number": 0
    })
    
    Enter Value For [pause action to continue]: 
    
    enter: continue 
        q: quit
        i: inspect
    
    ~SubStep1: [print:  ]
    hello global-var-a
    -Step3:
    self: final context exec vars:
    
    (*core.Cache)({
      "a": "global-var-a",
      "last_result": (*utils.ExecResult)({
        Cmd: "echo \"hello global-var-a\"",
        Code: 0,
        Output: "hello global-var-a",
        ErrMsg: ""
      }),
      "up_runtime_task_layer_number": 0
    })
    
    cmd( 1):
    echo "next step"
    
    -
    next step
    
    -
     .. ok
    . ok
    
Logs with different verbose level
Raw logs with different verbose level