Closed
Description
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 ofTaskfile.yml
and synchronizes updatesmanually
.
# 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:
- https://github.com/better-sre/config#usage
- This repo can also be used as an example directory structure, my Taskfile here is multi-level nested.
- About reusing Taskfile in different projects. Here, I gave 3 feasible solutions.
- This is my current practice of reusing public Taskfiles. It can solve the problem, but it is not convenient enough.
- I'm wondering if go-task can support option 2 or option 3.
Similar issues:
- Add "imports" or "includes" #98
- Adding URLs in includes #380
- Remote includes via Git #556
- "includes" path does not resolve {{.HOME}} variable #670
- Adding URLs in includes #380
- These are all discussing the same requirement.
A collection of taskfiles:
Metadata
Metadata
Assignees
Labels
No labels