osl-incubator / makim

Make Improved
https://osl-incubator.github.io/makim/
BSD 3-Clause "New" or "Revised" License
8 stars 10 forks source link

Add support for pipelines #26

Open xmnlab opened 1 year ago

xmnlab commented 1 year ago

In order to add support for pipelines, we could add a new entry in the root of the file for pipelines .. and create pipelines using any of the targets. Example:

version: 1.0.0
groups:
  main:
    env-file: .env
    targets:
      read:
        help: Read file
        args:
          filepath:
            type: string
            default:
        run: cat {{ args.filepath }}
      count:
        help:  Counts the number of lines in the input.
        run: wc -l

pipelines:
  count-lines-myfile:
    help: 
    tasks:
      - target: main.read
        args:
          filepath: /tmp/myfile.txt
      - target: main.count

makim could have an option to visualize the graph of the pipelines, maybe using asciinet. Example of a CLI call:

$ makim pipeline run count-lines-myfile
$ makim pipeline show count-lines-myfile