dvar to global
Showcase that you can use flag reg to extend the local defined dvar to be available in global runtime so that other func step could reference and use it
Demo
source
Main task yaml file
tasks:
- name: task
task:
- func: cmd
vars:
school_name: sydney grammar
school_address: 1 fox road, sydney, nsw 2000
dvars:
- name: school_details
value: '{{.school_name}} : {{.school_address}}'
flags: [reg]
do:
- name: print
cmd: '{{.school_name}}'
- name: print
cmd: '{{.school_details}}'
- func: cmd
do:
- name: print
cmd: '{{.school_address}}'
Main log file
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0078
Verbose -> vvv
ModuleName -> self
ShellType -> /bin/sh
MaxCallLayers -> 8
Timeout -> 3600000
MaxModuelCallLayers -> 256
EntryTask -> task
ModRepoUsernameRef ->
ModRepoPasswordRef ->
work dir: /up_project/up
-exec task: task
loading [Task]: ./tests/functests/c0078
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: ]
-Step1:
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0,
"school_name": "sydney grammar",
"school_address": "1 fox road, sydney, nsw 2000",
"school_details": "sydney grammar : 1 fox road, sydney, nsw 2000"
})
~SubStep1: [print: ]
sydney grammar
~SubStep2: [print: ]
sydney grammar : 1 fox road, sydney, nsw 2000
-Step2:
self: final context exec vars:
(*core.Cache)({
"school_details": "sydney grammar : 1 fox road, sydney, nsw 2000",
"up_runtime_task_layer_number": 0
})
~SubStep1: [print: ]
None
Logs with different verbose level
Raw logs with different verbose level