c0156_v
Log reference:
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0156
Verbose -> v
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/c0156
module: [self], instance id: [dev], exec profile: []
Task1: [task ==> task: ]
-Step1: [
1st solution: register object in any template rending
]
~SubStep1: [print: Use a actual cmd to register a variable does not make sense, but it is doable.
It is not advised to do it this way
]
|
sg:
name: sydney grammar
state: nsw
address: sydney
postcode: 2000
~SubStep2: [print: please note that myschool is only a string, but not an object
]
sg:
name: sydney grammar
state: nsw
address: sydney
postcode: 2000
~SubStep3: [print: please note that below result is only a string representation of the object
any golang template result can only be string, but not a object
]
sg:
address: sydney
name: sydney grammar
postcode: 2000
state: nsw
~SubStep4: [print: now register the object to a named var myschool_object
]
sg:
address: sydney
name: sydney grammar
postcode: 2000
state: nsw
~SubStep5: [print: same as above, this will only print the string reprentation of the object
]
map[sg:map[address:sydney name:sydney grammar postcode:2000 state:nsw]]
~SubStep6: [printObj: same as above, this will only print the string reprentation of the object
]
object:
map[sg:map[address:sydney name:sydney grammar postcode:2000 state:nsw]]: (interface {}) <nil>
~SubStep7: [printObj: * IMPORTANT
use the object var name to refer to the object in register
]
object:
myschool_object: (*map[interface {}]interface {})({
"sg": {
"name": "sydney grammar",
"state": "nsw",
"address": "sydney",
"postcode": 2000
}
})
-Step2: [
2nd solution:
use dvar auto coversion
]
dvar> myschool2:
"sg:\n name: sydney grammar\n state: nsw\n address: sydney\n postcode: 2000\n"
-
sg:
name: sydney grammar
state: nsw
address: sydney
postcode: 2000
dvar[object]> myschool2_object:
{
"sg": {
"postcode": 2000,
"name": "sydney grammar",
"state": "nsw",
"address": "sydney"
}
}
~SubStep1: [print: ]
sg:
name: sydney grammar
state: nsw
address: sydney
postcode: 2000
map[sg:map[address:sydney name:sydney grammar postcode:2000 state:nsw]]
~SubStep2: [printObj: ]
object:
myschool2_object: {
"sg": {
"state": "nsw",
"address": "sydney",
"postcode": 2000,
"name": "sydney grammar"
}
}
-Step3: [
3rd solution:
use toObj cmd
details: https://upcmd.netlify.app/cmd-func/c0095/
]
~SubStep1: [toObj: ]
~SubStep2: [printObj: ]
object:
myschool3_object: {
"sg": {
"name": "sydney grammar",
"state": "nsw",
"address": "sydney",
"postcode": 2000
}
}
Logs with different verbose level
References