basics
This showcases:
- how to use env var in your shell execution
Demo
source
Main task yaml file
dvars:
- name: homedir
value: '{{ env "HOME"}}'
flags: [vvvv]
- name: yourhome
value: '{{ expandenv "Your path is set to $HOME" }} '
flags: [vvvv]
tasks:
- name: task
task:
- func: cmd
do:
- name: print
cmd: '{{.homedir}}'
- name: print
cmd: '{{.yourhome}}'
- func: shell
do:
- echo """my home is at {{.homedir}}"""
- echo """my home is at $HOME"""
- echo """{{.yourhome}}"""
Main log file
loading [Config]: ./tests/functests/upconfig.yml
Main config:
Version -> 1.0.0
RefDir -> ./tests/functests
WorkDir -> cwd
AbsWorkDir -> /up_project/up
TaskFile -> c0044
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/c0044
module: [self], instance id: [dev], exec profile: []
profile - envVars:
(*core.Cache)({
})
dvar> homedir:
"/root"
-
/root
dvar> yourhome:
"Your path is set to /root "
-
Your path is set to /root
Task1: [task ==> task: ]
-Step1:
self: final context exec vars:
(*core.Cache)({
"homedir": "/root",
"yourhome": "Your path is set to /root ",
"up_runtime_task_layer_number": 0
})
~SubStep1: [print: ]
/root
~SubStep2: [print: ]
Your path is set to /root
-Step2:
self: final context exec vars:
(*core.Cache)({
"homedir": "/root",
"yourhome": "Your path is set to /root ",
"up_runtime_task_layer_number": 0
})
cmd( 1):
echo """my home is at {{.homedir}}"""
-
my home is at /root
-
.. ok
cmd( 2):
echo """my home is at $HOME"""
-
my home is at /root
-
.. ok
cmd( 3):
echo """{{.yourhome}}"""
-
Your path is set to /root
-
.. ok
. ok
Logs with different verbose level
Raw logs with different verbose level