This demo shows that a dvar stores a dynamic value, which is in yml format
The yml string could be converted to a object and registered in execution runtime. We will detail this later
vars:
student:
name: Tom
gender: Male
school: Sydney Grammar
dvars:
- name: a_smart_guy
value: |
name: "{{.student.name}}"
sex: "{{.student.gender}}"
school: "{{.student.school}}"
tasks:
- name: task
task:
- func: shell
do:
- echo """a smart guy=>{{.a_smart_guy}}"""
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0025
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/c0025
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,
"student": {
"gender": "Male",
"school": "Sydney Grammar",
"name": "Tom"
},
"a_smart_guy": "name: \"Tom\"\nsex: \"Male\"\nschool: \"Sydney Grammar\"\n"
})
cmd( 1):
echo """a smart guy=>{{.a_smart_guy}}"""
-
a smart guy=>name: Tom
sex: Male
school: Sydney Grammar
-
.. ok
. ok