github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0081.yml (about) 1 doc_meta: | 2 folder: design-patterns 3 title: externalise task def 4 head: | 5 To extend further more from previous example to show that you can use ref tag to externalise detailed task to separate files, in such a way it is much tidy and clear of your main skeleton of your program and focus what you want to achieve in high level 6 7 sections: 8 - title: Relavant 9 content: Externalise tasks 10 refs: 11 - title: externalise task and use flow 12 link: ../../organization/c0059 13 - title: externalise task and use flow 14 link: ../../organization/c0060 15 - title: externalise task and use flow 16 link: ../../organization/c0061 17 - title: externalise task and use tasksref 18 link: ../../organization/c0062 19 20 - title: c0081_task_compose_required_object.yml reference 21 filelookup: c0081_task_compose_required_object.yml 22 23 - title: c0081_task_render.yml reference 24 filelookup: c0081_task_render.yml 25 26 - title: Demo 27 log: yes 28 29 docs: 30 mddoc: | 31 extend c0080 to use composible main tasks using externised flow configuration 32 to make the whole task and flow clearer and modular 33 34 vars: 35 complex_data_structure_template: | 36 school: 37 name: '{{.school_name}}' 38 address: '{{.school_address}}' 39 principals: 40 {{- range $_, $p :=.schoo_principals }} 41 - {{$p}} 42 {{- end}} 43 ranking: '{{.schoo_ranking}}' 44 45 dvars: 46 - name: intest 47 value: '{{ env "GOTEST" |default "false" }}' 48 49 tasks: 50 - 51 name: task 52 task: 53 - 54 func: call 55 do: 56 - compose_required_object 57 - render 58 59 - 60 name: compose_required_object 61 desc: prepare the data object for rendering 62 ref: c0081_task_compose_required_object.yml 63 64 - 65 name: render 66 desc: render data 67 ref: c0081_task_render.yml