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

     1  doc_meta: |
     2    folder: usage
     3    title: public and protected tasks
     4    head: |
     5      It is a implicit rule that it is a public task if the task name start with a upper case letter, otherwise it is a protected task
     6  
     7      The intention is that public tasks is a callerable one from CLI command, which could have a chaine of depenent protected tasks for detailed implementations
     8  
     9      Also, for collaboration of different projects, it is a implicit rule that public task is more like a interface to be consumable and protected tasks are internal private business.
    10  
    11      There is no hard rule to forbid you to use protected tasks, it is just a mutual common contract to collaborate with each other in a clear standard
    12  
    13    sections:
    14      - title: How to run
    15        content: |
    16          ```
    17          up list  -d ./tests/functests -t c0140.yml -i dev --configdir=./tests/functests
    18          loading [Config]:  ./tests/functests/upconfig
    19          loading [Task]:  ./tests/functests/c0140.yml
    20          instance id: dev
    21          -task list
    22           1  |     Main: |   public| main entry
    23           2  |    Build: |   public| A build task
    24           3  | internal: |protected| a internal process needed by Build
    25          -
    26          ```
    27  
    28      - title: Demo
    29        log: yes
    30  
    31  tasks:
    32    -
    33      name: task
    34      desc: main entry
    35      task:
    36        -
    37          func: cmd
    38          do:
    39            - name: print
    40              cmd: 'I am the main entry'
    41    -
    42      name: Build
    43      desc: A build task
    44      task:
    45        -
    46          func: cmd
    47          do:
    48            - name: print
    49              cmd: 'I am the build task'
    50  
    51        -
    52          func: call
    53          do:
    54            - internal
    55  
    56    -
    57      name: internal
    58      desc: a internal process needed by Build
    59      task:
    60        -
    61          func: cmd
    62          do:
    63            - name: print
    64              cmd: 'I am a internal task'
    65