complext object
Showcase a dvar’s value could reference to a object’s sub element
Demo
source
Main task yaml file
vars:
student:
name: Tom
gender: Male
school: Sydney Grammar
dvars:
- name: studentname
value: "{{.student.name}}"
- name: studentgender
value: "{{.student.gender}}"
tasks:
- name: task
task:
- func: shell
do:
- echo "student=>{{.student}}"
- echo "name=>{{.studentname}}"
- echo "gender=>{{.studentgender}}"
- echo "school=>{{.student.school}}"
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 -> c0024
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/c0024
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: ]
-Step1:
self: final context exec vars:
(*core.Cache)({
"student": {
"school": "Sydney Grammar",
"name": "Tom",
"gender": "Male"
},
"studentname": "Tom",
"studentgender": "Male",
"up_runtime_task_layer_number": 0
})
cmd( 1):
echo "student=>{{.student}}"
-
student=>map[gender:Male name:Tom school:Sydney Grammar]
-
.. ok
cmd( 2):
echo "name=>{{.studentname}}"
-
name=>Tom
-
.. ok
cmd( 3):
echo "gender=>{{.studentgender}}"
-
gender=>Male
-
.. ok
cmd( 4):
echo "school=>{{.student.school}}"
-
school=>Sydney Grammar
-
.. ok
. ok
Logs with different verbose level
Raw logs with different verbose level