millerovtr
millerovtr
TTask
Created by millerovtr on 1/27/2025 in #help
How to define global variables for all taskfiles
Let me give you more context: I have a structure like
project-root/

├── Taskfile.yml
├── stream1/
│ ├── component1/
│ │ └── Taskfile.yml
│ ├── component2/
│ │ └── Taskfile.yml
├── stream2/
│ ├── component1/
│ │ └── Taskfile.yml
project-root/

├── Taskfile.yml
├── stream1/
│ ├── component1/
│ │ └── Taskfile.yml
│ ├── component2/
│ │ └── Taskfile.yml
├── stream2/
│ ├── component1/
│ │ └── Taskfile.yml
And for each Taskfile.yml I want to have command that I want to call in any directory in cd project-root I want to have: - task command - task stream1:command - task stream1:component1:command cd project-root/stream1: - task command - task component1:command cd project-root/stream1/task1: - task command And task with includes works great for this structure. But I want to define some variables that will be available in every Taskfile. It's doesn't matter from what directory I calls task, it should use variables that I defined somewhere in one place. There may be about 10 of these variables and I would not have to copy them to each Taskfile. May be you can suggest some other options how to resolve my issue 🙂
3 replies