Skip to content

New Feature: A Compromise Solution For Reusing common Taskfiles In Different Projects #770

@hhstore

Description

@hhstore

Background:

  • There are many issues being discussed about reusing common Taskfiles.
  • It can be seen that this demand is very strong.
  • Given that the remote include solution doesn't work. I think of a compromise solution.

A Compromise Solution:

like this:

includes:
  sre:
    taskfile:  "https://github.com/better-sre/config"
    type: git+local         # or git+global
    dir: ./.task/xxx        # or ~/.local/.task/xxx
    sync: auto              # sync github: daily check
  • When include contains type option is git.
  • It will automatically check if the .task/ (or ~/.local/.task/) path has the same name path.
  • If it exists, use the local path directly.
  • If not, automatically git clone to .task/ ( or ~/.local/.task/) path.
  • In addition, task adds a new command. task sync, which automatically detects the include section of Taskfile.yml and synchronizes updates manually.
# automatically detects the include section of `Taskfile.yml` and synchronizes updates `manually`.
task sync
  • This solution is still based on the local path. There is no difficulty in implementation.
  • But it solves the problem of convenience.

Reference:

My current solution:

image

Similar issues:

A collection of taskfiles:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions