Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override dist taskfile #1873

Open
lrob opened this issue Oct 21, 2024 · 1 comment
Open

override dist taskfile #1873

lrob opened this issue Oct 21, 2024 · 1 comment
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@lrob
Copy link

lrob commented Oct 21, 2024

If not already possible, and I missed it, it would be very useful to be able to override only certain fields of a taskfile.dist.yml with a local taskfile.yml. Just like in docker compose with docker-compose.override.yml. Here is the documentation for it.

This would have several advantages: the most important, I think, are:

  1. The taskfile.yml would usually be very short, because the fields to be overridden are usually only a few.
  2. if any part of the dist file is modified, this is automatically inherited by the local taskfile.yml.
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Oct 21, 2024
@trulede
Copy link

trulede commented Jan 3, 2025

@lrob You could use the existing include mechanism to achieve the same effect.

The specification of the included taskfile name uses a template mechanism, so it would even be possible to select which file to include at runtime. For example:

version: '3'

includes:
  lib:
    taskfile: ./Taskfile.{{REL}}.yml    //resolves to a taskfile containing task 'do_stuff'
    flatten: true                              // no namespace, just call task'do_stuff' directly

Then run task: REL=debug task do_stuff ... or similar. There is a lot of possibility from there.

https://taskfile.dev/usage/#flatten-includes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

3 participants