simple vars

Showcase a simplest module example by using only a sub directory

It shows that the caller task to call the module task Say_world

source

config file - upconfig.yml

    
    version: 1.0.0
    Verbose: vvv
    MaxCallLayers: 8
    RefDir: .
    TaskFile: up.yml
    ConfigDir: .
    ConfigFile: upconfig.yml
    
    Modules:
    
       #if there is no repo, then it will use the dir as module and incorporate as module
      - dir: hello-module/
        alias: hello-module
        iid: dev
    

up task - up.yml

    notes:
      - see if callers vars could be passed to module's func
    
    tasks:
      -
        name: Main
        desc: main entry
        task:
          -
            func: shell
            desc: main job
            do:
              - 'echo "hello world"'
    
          -
            func: call
            do: internal_task
    
          -
            func: call
            vars:
              a: caller-aaa
            do: hello-module.Say_world
    
      -
        name: internal_task
        task:
          -
            func: cmd
            do:
              - name: print
                cmd: "this is a internal task"
    

up module task - up.yml

    
    tasks:
      -
        name: Main
        desc: main entry
        task:
          -
            func: shell
            desc: main job
            do:
              - echo "hello "
    
      -
        name: Say_world
        task:
          -
            func: cmd
            vars:
              a: module-aaa
              b: module-bbb
            do:
              - name: print
                cmd: |
                  ... module world
                  a: {{.a}}
                  b: {{.b}}
    
              -
                name: assert
                cmd:
                  - '{{eq .a "caller-aaa"}}'
                  - '{{eq .b "module-bbb"}}'
    
Main log file
    loading [Config]:  ./tests/modtests/0002/upconfig.yml
    Main config:
                 Version -> 1.0.0
                  RefDir -> ./tests/modtests/0002
                 WorkDir -> refdir
              AbsWorkDir -> /up_project/up/tests/modtests/0002
                TaskFile -> up.yml
                 Verbose -> v
              ModuleName -> self
               ShellType -> /bin/sh
           MaxCallLayers -> 8
                 Timeout -> 3600000
     MaxModuelCallLayers -> 256
               EntryTask -> Main
      ModRepoUsernameRef -> 
      ModRepoPasswordRef -> 
    work dir: /up_project/up/tests/modtests/0002
    -exec task: Main
    loading [Task]:  ./up.yml
    module: [self], instance id: [dev], exec profile: []
    Task1: [Main ==> Main: main entry ]
    -Step1: [: main job ]
    cmd( 1):
    -
    hello world
    
    -
     .. ok
    . ok
    -Step2:
    =Task2: [Main ==> internal_task:  ]
    --Step1:
    ~~SubStep1: [print:  ]
    this is a internal task
    -Step3:
    loading [Config]:  ./upconfig.yml
    loading [Task]:  ./up.yml
    module: [hello-module], instance id: [dev], exec profile: []
    =>call module: [hello-module] task: [Say_world]
    Task2: [TODO: Main Caller Taskname ==> Say_world:  ]
    -Step1:
    ~SubStep1: [print:  ]
    ... module world
    a: caller-aaa
    b: module-bbb
    
    ~SubStep2: [assert:  ]
     1 ASSERT OK:     [{{eq .a "caller-aaa"}}]
     2 ASSERT OK:     [{{eq .b "module-bbb"}}]
    
Logs with different verbose level
Raw logs with different verbose level