By default the the refdir should be from below command line, its value will be: ./tests/functests
up ngo -d ./tests/functests -t $1 -i dev -v vvvv --configdir=./tests/functests
In this case, the refdir is overriden using your own customised location
load task using refdir
vars:
student:
name: Tom
gender: Male
address:
suburb:
name: sydney
postcode: 2000
CBD: yes
school: Sydney Grammar
tasks:
- name: task
desc: use dynamic dir instead of static ref dir
task:
- func: shell
vars:
dynadir: ./tests/functests
dvars:
- name: sgp_address_dyna_dir
ref: d0030_school.yml
refdir: '{{.dynadir}}'
flags: [toObj, vvvv]
do:
- echo """1.address -> \n{{.sgp_address_dyna_dir}}"""
- echo """1.address object-> \n{{.sgp_address_dyna_dir_object}}"""
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0088
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/c0088
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: use dynamic dir instead of static ref dir ]
-Step1:
dvar> sgp_address_dyna_dir:
"address:\n suburb:\n name: sydney\n postcode: 2000\n CBD: yes\n school: Sydney Grammar\n"
-
address:
suburb:
name: sydney
postcode: 2000
CBD: yes
school: Sydney Grammar
dvar[object]> sgp_address_dyna_dir_object:
{
"address": {
"suburb": {
"postcode": 2000,
"CBD": true,
"name": "sydney"
},
"school": "Sydney Grammar"
}
}
self: final context exec vars:
(*core.Cache)({
"student": {
"address": {
"suburb": {
"postcode": 2000,
"cbd": true,
"name": "sydney"
},
"school": "Sydney Grammar"
},
"name": "Tom",
"gender": "Male"
},
"up_runtime_task_layer_number": 0,
"dynadir": "./tests/functests",
"sgp_address_dyna_dir": "address:\n suburb:\n name: sydney\n postcode: 2000\n CBD: yes\n school: Sydney Grammar\n",
"sgp_address_dyna_dir_object": {
"address": {
"suburb": {
"postcode": 2000,
"CBD": true,
"name": "sydney"
},
"school": "Sydney Grammar"
}
}
})
cmd( 1):
echo """1.address -> \n{{.sgp_address_dyna_dir}}"""
-
1.address -> \naddress:
suburb:
name: sydney
postcode: 2000
CBD: yes
school: Sydney Grammar
-
.. ok
cmd( 2):
echo """1.address object-> \n{{.sgp_address_dyna_dir_object}}"""
-
1.address object-> \nmap[address:map[school:Sydney Grammar suburb:map[CBD:true name:sydney postcode:2000]]]
-
.. ok
. ok