HelloWorld example

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

How does it work?

If you need to call an external module task, then you will need to use module name with a dot, eg: “hello-module.Say_world” stands for module name hello-module, then call Say_world task

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
    

up task - up.yml

    tasks:
      -
        name: Main
        desc: main entry
        task:
          -
            func: shell
            desc: main job
            do:
              - 'echo "hello world"'
    
          -
            func: call
            do: internal_task
    
          -
            func: call
            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: aaa
            do:
              - name: print
                cmd: "... world"
    
    
Main log file
    loading [Config]:  ./tests/modtests/0001/upconfig.yml
    Main config:
                 Version -> 1.0.0
                  RefDir -> ./tests/modtests/0001
                 WorkDir -> refdir
              AbsWorkDir -> /up_project/up/tests/modtests/0001
                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/0001
    -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: [nonamed], exec profile: []
     WARN: [*be aware*] - [both instance id and exec profile are not set]
    =>call module: [hello-module] task: [Say_world]
    Task2: [TODO: Main Caller Taskname ==> Say_world:  ]
    -Step1:
    ~SubStep1: [print:  ]
    ... world
    
Logs with different verbose level
Raw logs with different verbose level