github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/modtests/0006/hello-module/up.yml (about)

     1  
     2  vars:
     3    a: module-global-aaa
     4    c: module-global-ccc
     5  
     6  tasks:
     7    -
     8      name: Main
     9      desc: main entry
    10      task:
    11        -
    12          func: shell
    13          desc: main job
    14          do:
    15            - echo "hello "
    16  
    17        -
    18          func: call
    19          do: Say_world
    20  
    21    -
    22      name: Say_world
    23      task:
    24        -
    25          func: cmd
    26          vars:
    27            a: module-local-aaa
    28            b: module-local-bbb
    29            d: module-local-ddd
    30          do:
    31            -
    32              name: inspect
    33              desc: |
    34                the result would be:
    35                a: caller-global-aaa
    36                b: caller-global-bbb
    37                c: module-global-ccc
    38                d: module-local-ddd
    39                e: caller-global-eee
    40              cmd:
    41                - exec_vars
    42                - exec_base_vars
    43  
    44            -
    45              name: assert
    46              cmd:
    47                - '{{eq .a "caller-global-aaa"}}'
    48                - '{{eq .b "caller-global-bbb"}}'
    49                - '{{eq .c "module-global-ccc"}}'
    50                - '{{eq .d "module-local-ddd"}}'
    51                - '{{eq .e "caller-global-eee"}}'
    52  
    53            - name: return
    54              cmd:
    55                - c
    56  
    57        -
    58          func: call
    59          vars:
    60            a: module-local-call-aaa
    61            b: module-local-call-bbb
    62            d: module-local-call-ddd
    63            h: module-local-call-hhh
    64            i: module-local-call-iii
    65          do: second_layer_internal_call
    66  
    67        -
    68          func: cmd
    69          do:
    70            - name: return
    71              desc: var k is return from second_layer_internal_call
    72              cmd:
    73                - k
    74  
    75    -
    76      name: second_layer_internal_call
    77      task:
    78        -
    79          func: cmd
    80          vars:
    81            a: module-second_layer_local-aaa
    82            b: module-second_layer_local-bbb
    83            d: module-second_layer_local-ddd
    84            i: module-second_layer_local-iii
    85            k: module-second_layer_local-kkk
    86  
    87          do:
    88            -
    89              name: inspect
    90              desc: |
    91                second_layer_internal_call
    92                a: module-local-call-aaa
    93                b: module-local-call-bbb
    94                d: module-local-call-ddd
    95              cmd:
    96                - exec_vars
    97                - exec_base_vars
    98  
    99            -
   100              name: assert
   101              cmd:
   102                - '{{eq .a "caller-global-aaa"}}'
   103                - '{{eq .b "caller-global-bbb"}}'
   104                - '{{eq .c "module-global-ccc"}}'
   105                - '{{eq .d "module-local-call-ddd"}}'
   106                - '{{eq .e "caller-global-eee"}}'
   107                - '{{eq .i "module-local-call-iii"}}'
   108                - '{{eq .h "module-local-call-hhh"}}'
   109                - '{{eq .k "module-second_layer_local-kkk"}}'
   110  
   111            - name: return
   112              cmd:
   113                - k