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

     1  doc_meta: |
     2    folder: quick-start
     3    title: a little taste of UPcmd
     4    head: |
     5      This is a demo case of UPcmd for the home page
     6  
     7    sections:
     8      - title: Demo
     9        log: yes
    10  
    11  Vars:
    12    greet_to: Tom
    13    weather: sunny
    14  
    15  tasks:
    16    -
    17      name: task
    18      desc: main task of hello world demo of UPcmd
    19      task:
    20        -
    21          func: call
    22          desc: greet to Tom
    23          do:
    24            - greet
    25  
    26        -
    27          func: call
    28          desc: greet to Grace
    29          vars:
    30            greet_to: Grace
    31          do:
    32            - greet
    33  
    34  
    35        -
    36          func: cmd
    37          desc: do  you get the idea?
    38          do:
    39            - name: print
    40              cmd: |
    41                Have you got a little taste of using the UPcmd?
    42  
    43        -
    44          func: call
    45          desc: greet to a team
    46          vars:
    47            team:
    48              - Jason
    49              - Connie
    50            weather: stormy
    51          loop: team
    52          do:
    53            - sayhi
    54  
    55    -
    56      name: greet
    57      desc: greet to some one
    58      task:
    59        -
    60          func: shell
    61          desc: say hello
    62          do:
    63            - echo "Hello, {{.greet_to}}"
    64  
    65        -
    66          func: cmd
    67          desc: talk about weather
    68          do:
    69            - name: print
    70              cmd: 'It is {{.weather}}'
    71  
    72        -
    73          func: cmd
    74          desc: ice break
    75          do:
    76            - name: print
    77              cmd: 'What a great day!'
    78          if: '{{eq .weather "sunny"}}'
    79          else:
    80            -
    81              func: cmd
    82              do:
    83                - name: print
    84                  cmd: 'What a bad day!!'
    85  
    86    -
    87      name: sayhi
    88      desc: say hi to some one
    89      task:
    90        -
    91          func: cmd
    92          desc: say hi to someone
    93          do:
    94            - name: print
    95              cmd: 'Hi {{.loopitem}}, how are you?'
    96  
    97        -
    98          func: call
    99          desc: greet to the team member
   100          dvars:
   101            - name: greet_to
   102              value: '{{.loopitem}}'
   103          do:
   104            - greet