zloeber / taskfiles

A library of Taskfiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Taskfiles Collection

This is a library of taskfile.dev definitions for things you may do at a cli once in a while or maybe multiple times a day.

Configuration

You can install mise and other requirements via ./.configure.sh.

Additional Software

Mise handles a good deal of software you might use in a taskfile. Check if whatever binary you are looking for with mise install <binary>. If it is not installed then you can use rust, go, or python packages with mise as well. One example of this is in this project's .mise.toml file for eget (which is a last ditch method to automatically install binary releases from github). You can use eget to install binaries into your user local bin path like so eget canop/broot --to ~/.local/bin

Variables

You can overwrite most variables by including a Taskfile.vars.yml file with the variables you wish to overwrite. Or you can include the variable name assignment prior to calling task in most cases.

Notes

Docker Image

This includes a rudimentary docker image you can use to run most tasks. Simply build it with the task

task docker:build docker:shell

Then when you are in the running container start up zsh for a better shell experience. Then you can run task or any other binaries included in .mise.toml

/bin/zsh

Usage

To use this in a project you need only copy the tasks folder and Taskfile.yml/Taskfile.vars.yml to your project root. You need only keep files in the tasks folder that you plan on using.

TIP Monorepo project? To use the tasks within subfolders simply soft link the Taskfile.yml and tasks folder into it. Then create a per-folder Taskfile.vars.yml file if needed.

You can use vendir to sync versions of this repo into your own if you like. Create a vendir.yml file with contents like the following:

apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
  - path: ./.tasks
    contents:
      - path: ./
        git:
          url: https://github.com/zloeber/taskfiles.git
          ref: main
        includePaths:
          - tasks/**/*
          - Taskfile.yml
          - Taskfile.vars.yml

Then at the root of your project run:

vendir sync
ln -s ./.tasks/tasks ./
ln -s ./.tasks/Taskfile.yml ./
cp ./.tasks/Taskfile.vars.yml ./

Finish off by adding .tasks to your ./.gitignore

NOTE You can keep any custom tasks in ./Taskfile.custom.yml but you cannot use dotenv sourcing within them. Use .mise.toml to do this instead!

NOTE You can change variables in Taskfile.vars.yml as you see fit. If you softlink the base Taskfile.yml to subdirectories (for monorepos perhaps) adding another local var file to customize the targets may make sense.

Development

Fork this repo, make updates, send a PR for approval. If you update this readme ensure to run task toc to update the table of contents.

About

A library of Taskfiles

License:Apache License 2.0


Languages

Language:Shell 88.4%Language:PowerShell 5.8%Language:Python 4.3%Language:Dockerfile 0.8%Language:Ruby 0.5%Language:HCL 0.2%Language:Smarty 0.0%