Getting started
Requirements
Pre-requisites
Structure
.
├─ Taskfile.d/
│ ├─ ...
│ ├─ git.yml
│ ├─ lint.yml
│ └─ ...
├─ Taskfile.project.yml
└─ Taskfile.yml
Notes
Taskfile.d
: Directory of the task template filesTaskfile.project.yml
: Task file for the project that has theTASK_TEMPLATES
variableTaskfile.yml
: Core Task file with generic tasks, don't edit it!
Installation
Download the main Taskfile.yml
and the project file template Taskfile.project.yml
:
with curl
:
or with wget
:
Warning
On Alpine Linux, --show-progress
option isn't available.
Setup
Select your templates by editing the Taskfile.project.yml
file variable TASK_TEMPLATES
:
example:
and run:
A specific version of a template can be specify as follow:
example for git version 1.7.3
:
Git configuration (Optional)
Taskfile.project.yml
is the file that has your specific project tasks. You should probably commit it.
If you always want the last version of the task templates, add this following line in your .gitignore
file
Otherwise, if you prefer stability you should also commit the content of the Taskfile.d
directory or specify the versions of the templates.
Usage
task
command without any parameter shows the available installed tasks:
- Example of usage with the
lint
template:
❯ task lint:pre-commit
Using default tag: latest
latest: Pulling from jfxs/pre-commit
Digest: sha256:5bd813b076fed1fb566e59e163d27e382df599822fb1b187eb6020402b9351e5
Status: Image is up to date for jfxs/pre-commit:latest
docker.io/jfxs/pre-commit:latest
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check for added large files..............................................Passed
check that executables have shebangs.................(no files to check)Skipped
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed
check that scripts with shebangs are executable..........................Passed
check for broken symlinks............................(no files to check)Skipped
check toml...............................................................Passed
check xml................................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
fix utf-8 byte order marker..............................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
- Example of usage with the project task
20-generate-doc
defined as follow:
❯ task 00:20-generate-doc
Collecting task2md
Downloading task2md-1.1.2-py3-none-any.whl.metadata (3.7 kB)
Collecting click>=8.1.7 (from task2md)
Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting pydantic>=2.6.3 (from task2md)
...
Task documentation generated: lint.md
Task documentation generated: version.md
Task documentation generated: git.md
Index documentation generated: index.md
Checks Start Jeu 25 avr 2024 20:13:11 CEST - End Jeu 25 avr 2024 20:13:15 CEST
Upgrade
- To upgrade your existing templates, just run the command:
- To add a new template, add it to the variable
TASK_TEMPLATES
and runtask install-templates
.