tasks:
- name: task
task:
- func: shell
desc: |
The envVar flag makes the dvar name STUDENT_NAME is accessible as environment vars
dvars:
- name: STUDENT_NAME
value: Tom Hanks
flags: [envVar]
do:
- env |grep STUDENT_NAME
- func: shell
desc: |
STUDENT_NAME is also accessible in dvar processing
dvars:
- name: STUDENT_NAME
value: Tom Hanks
flags: [envVar]
- name: student_name_re_map
value: '{{ env "STUDENT_NAME" |default "student_name_re_map" }}'
do:
- env |grep STUDENT_NAME
- echo "student_name_re_map is [{{.student_name_re_map}}]"
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0048
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/c0048
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
Task1: [task ==> task: ]
-Step1: [
The envVar flag makes the dvar name STUDENT_NAME is accessible as environment vars
]
self: final context exec vars:
(*core.Cache)({
"up_runtime_task_layer_number": 0,
"STUDENT_NAME": "Tom Hanks",
"envVar_STUDENT_NAME": "Tom Hanks"
})
cmd( 1):
env |grep STUDENT_NAME
-
STUDENT_NAME=Tom Hanks
-
.. ok
. ok
-Step2: [
STUDENT_NAME is also accessible in dvar processing
]
self: final context exec vars:
(*core.Cache)({
"student_name_re_map": "Tom Hanks",
"last_result": (*utils.ExecResult)({
Cmd: "env |grep STUDENT_NAME",
Code: 0,
Output: "STUDENT_NAME=Tom Hanks",
ErrMsg: ""
}),
"up_runtime_task_layer_number": 0,
"STUDENT_NAME": "Tom Hanks",
"envVar_STUDENT_NAME": "Tom Hanks"
})
cmd( 1):
env |grep STUDENT_NAME
-
STUDENT_NAME=Tom Hanks
-
.. ok
cmd( 2):
echo "student_name_re_map is [{{.student_name_re_map}}]"
-
student_name_re_map is [Tom Hanks]
-
.. ok
. ok
exec profile