github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0043.yml (about)

     1  doc_meta: |
     2    folder: design-patterns
     3    title: workflow skeleton
     4    head: |
     5      When you are developing your workflow and try to achieve it step by step, you do not need to put the detailed and trivals programming code precisely in one go. You could lay the basic building blocks by puting main task, the callee(dependant) tasks for implementation there. You don't have to put detailed step and concrete implmentation, as shown in this demo, you can leave the do element empty.
     6  
     7      In fact, for certain steps, their jobs are probably just to do data transformation
     8  
     9    sections:
    10      - title: Demo
    11        log: yes
    12  
    13  notes:
    14    goal:
    15      - to show that you can use empty do list
    16      - introduce a new funcname cmd to do var/dvar conversion
    17      - in cmd, you can also do reg/deReg var in dvar evaluation
    18  
    19  tasks:
    20  
    21    -
    22      name: task
    23      task:
    24        -
    25          func: shell
    26          do: []
    27  
    28        -
    29          func: shell
    30          #this would be totally fine
    31          #this step could be served as skeleton work as DESIGN step
    32          #and leave the implementation in future to be filled in
    33          #you can add desc field to describe what to plan to implement
    34  
    35        -
    36          func: shell
    37          desc: |
    38            this would be totally fine too without shell commands
    39            this step could be served as a intermediate step to
    40            register a var into global var map, and it will be
    41            avaiable after the next step
    42          vars:
    43            a: aa
    44            b: bb
    45          dvars:
    46            - name: adebug
    47              value: "{{.a}}"
    48              flags: [vvvv,]
    49  
    50        -
    51          func: cmd
    52          desc: |
    53            in cmd, you can also do reg/deReg var in dvar evaluation
    54            the cmd func name makes more sense then shell func
    55            if you really want to do var manipulation only
    56          vars:
    57            c: cc
    58            d: dd
    59          dvars:
    60            - name: cdebug
    61              value: "{{.c}}"
    62              flags: [vvvv,]
    63