github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0061.yml (about) 1 doc_meta: | 2 folder: organization 3 title: use case 2 4 head: | 5 Showcase gradually the lengthy configuration evolve to simpler skeleton by using ref element to externalized task/flow. Please also checkout the changes of: use case 1 6 7 sections: 8 - title: Externalized the task definition - c0061-task-main.yml 9 filelookup: c0061-task-main.yml 10 11 - title: Externalized the task definition - c0061-task-complicate.yml 12 filelookup: c0061-task-complicate.yml 13 14 - title: flow element 15 content: | 16 Introduce the flow element to notate a task reference 17 18 With ref element in main tasks file, this will make the entry point much cleaner and the main skeleton design stand out 19 20 - title: Demo 21 log: yes 22 23 notes: 24 goal: 25 - show a little bit more complicated use case with chained tasks and externalised tasks 26 - show how to use condition(basics) 27 - show how to use loop(basics) 28 - for details of condition/loop, check the comphensive case of them separately 29 30 vars: 31 student_name: tom 32 classes: [1k,2b,3j,4s] 33 34 tasks: 35 36 - 37 name: task 38 ref: c0061-task-main.yml 39 refdir: ./tests/functests 40 41 - 42 name: a_very_complicated_task 43 desc: "a_very_complicated_task" 44 ref: c0061-task-complicate.yml 45 46 - 47 name: task_a 48 task: 49 - 50 func: shell 51 do: 52 - echo "task_a_step1" 53 - 54 name: task_c 55 task: 56 - 57 func: shell 58 do: 59 - echo "task_c_step1" 60 61 - 62 name: task_b 63 task: 64 - 65 func: shell 66 do: 67 - echo "task_b_step1" 68 - echo "{{.loopindex}} -> student nameed {{.student_name}} has been in class [{{.loopitem}}]" 69