Task Lib is a collection of re-usable tasks that work with taskfile.dev.
There is currently no native way to include remote task files into your project, but you have a couple of options.
You can use go-getter to pull updates as needed. You can even implement this as a task in your Taskfile.yml
.
update:
desc: Update task dependencies
cmds:
- for: [tilt, python, rancher, yamlfmt]
cmd: |
go-getter github.com/GetDutchie/task-lib/tools/{{.ITEM}} .task/lib/tools/{{.ITEM}}
This task will loop throught the components listed and download them to .task/lib/tools/<component>
.
Don't like fetching updates? Take a look at Git Tools Submodules for information on submodules for git. Then include this repo (or a fork) as a submodule at .task
or .task-lib
.
Now that the library taskfiles have been fetched they can be used. Taskfiles can include other taskfiles.
includes:
tilt: ".task/lib/tools/tilt/task.yaml"
python: ".task/lib/tools/python/task.yaml"
rancher: ".task/lib/tools/rancher/task.yaml"
yamlfmt: ".task/lib/tools/yamlfmt/task.yaml"
You can then call the includes taskfiles and their tasks with the <namespace>:<task>
format. For example:
setup:
cmds:
- task: yamlfmt:install
The setup task will now call the yamlfmt
libraries install
task.
On Windows by default tools get installed in ${HOME}/tools
. Make sure to add this to your path.