Rozbicie dużego Taskfile.yml na mniejsze pliki za pomocą include.
project/
├── Taskfile.yml # Main file — includes + local overrides
├── tasks/
│ ├── build.yml # Build tasks + variables
│ ├── deploy.yml # Deploy tasks + environments (prefix: deploy)
│ └── test.yml # Test/lint tasks
└── README.md
include Works# Taskfile.yml
include:
- path: ./tasks/build.yml # Merge tasks as-is
- path: ./tasks/deploy.yml
prefix: deploy # Tasks become: deploy-local, deploy-staging, deploy-prod
- path: ./tasks/test.yml # Simple string path also works
{prefix}- to included task names| Section | Merged | Local Wins |
|---|---|---|
tasks |
✅ | ✅ |
variables |
✅ | ✅ |
environments |
✅ | ✅ |
pipeline |
❌ (main only) | — |
compose |
❌ (main only) | — |
# All included tasks are available as if defined locally
taskfile list
taskfile run build # from tasks/build.yml
taskfile run test # from tasks/test.yml
taskfile run lint # from tasks/test.yml
taskfile run deploy-local # from tasks/deploy.yml (prefixed)
taskfile run deploy-staging # from tasks/deploy.yml (prefixed)
taskfile run deploy-prod # from tasks/deploy.yml (prefixed)
taskfile run all # local task, depends on included tasks
# Validate (includes are resolved during parsing)
taskfile validate
# String shorthand
include:
- ./tasks/build.yml
# Dict with path
include:
- path: ./tasks/build.yml
# Dict with prefix
include:
- path: ./tasks/deploy.yml
prefix: deploy
# Dict with file (alias for path)
include:
- file: ./tasks/test.yml