datapath: format is like a.b.c(name=fr*).value, following the yq path format:
templating using datakey and datapath
query details
vars:
student:
name: Tom
gender: Male
school: Sydney Grammar
nsw:
sydney:
sgschool:
student:
name: Tom
gender: Male
school: Sydney Grammar
aaa: aaa
datapointer: student
tasks:
- name: task
task:
- func: cmd
desc: use sub element of an var as context to render values
dvars:
- name: student_info
value: 'my name is:{{.name}} and I am in {{.school}}'
datapath: nsw.sydney.sgschool.student
flags: [vvv]
do:
- name: print
cmd: '{{.student_info}}'
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0098
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/c0098
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: ]
-Step1: [: use sub element of an var as context to render values ]
dvar> student_info:
"my name is:<no value> and I am in <no value>"
-
my name is:<no value> and I am in <no value>
self: final context exec vars:
(*core.Cache)({
"nsw": {
"sydney": {
"sgschool": {
"student": {
"gender": "Male",
"school": "Sydney Grammar",
"name": "Tom"
}
}
}
},
"aaa": "aaa",
"datapointer": "student",
"up_runtime_task_layer_number": 0,
"student_info": "my name is:<no value> and I am in <no value>",
"student": {
"school": "Sydney Grammar",
"name": "Tom",
"gender": "Male"
}
})
~SubStep1: [print: ]
my name is:<no value> and I am in <no value>