Skip to content

yonasBSD/task-templates

Repository files navigation

Task templates

Software License semantic-release: angular Pipeline Status

A set of reusable Task templates, ready to use.

Documentation is available: https://task-templates.pages.dev

Getting started

Requirements

To use:

  • Task
  • curl or wget
  • Docker (recommended): Many templates use Docker images to avoid installing software.

Structure

  • Taskfile.d: Directory of the task template files
  • Taskfile.project.yml: Task file for the project that has the TASK_TEMPLATES variable
  • Taskfile.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:

curl --progress-bar -o Taskfile.yml https://gitlab.com/op_so/task/task-templates/-/raw/main/Taskfile.dist.yml
curl --progress-bar -o Taskfile.project.yml https://gitlab.com/op_so/task/task-templates/-/raw/main/Taskfile.project.dist.yml

or with wget:

wget -cq --show-progress -O Taskfile.yml https://gitlab.com/op_so/task/task-templates/-/raw/main/Taskfile.dist.yml
wget -cq --show-progress -O Taskfile.project.yml https://gitlab.com/op_so/task/task-templates/-/raw/main/Taskfile.project.dist.yml

On Alpine Linux, --show-progress option isn't available.

  • Select your templates by editing the Taskfile.project.yml file variable TASK_TEMPLATES:

example:

vars:
  TASK_TEMPLATES: go,lint

and run:

task install-templates

A specific version of a template can be specify as follow:

example for go:

vars:
  TASK_TEMPLATES: go[1.7.3],lint
  • Git:

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

/Taskfile.d/

Otherwise, if you prefer stability you should also commit the content of the Taskfile.d directory or specify the versions of the templates.

  • task command without any parameter shows the available installed tasks: Available tasks

Available templates

  • ansible.yml: Ansible common tasks
  • crypto.yml: Cryptographic tasks, generate keys, certificates
  • docker.yml: Docker common tasks
  • git.yml: Git signed commit and commitizen tasks
  • go.yml: Go tasks
  • lint.yml: A set of tasks to lint different types of files.
  • multipass.yml: Multipass tasks
  • poetry.yml: Poetry Python tasks
  • python.yml: Python common tasks
  • robot.yml: Robot Framework useful tasks
  • sbom.yml: Software bill of materials (SBOM) commands with syft and cosign
  • url.yml: Check URL with curl
  • version.yml: Useful version tasks like get last version on Github, pypi
  • yarn.yml: yarn common tasks with Docker

For details go to the templates documentation.

Upgrade

  • To upgrade your existing templates, just run the command: task install-templates,
  • To add a new template, add it to the variable TASK_TEMPLATES and run task install-templates.

Authors

License

This program is free software: you can redistribute it and/or modify it under the terms of the MIT License (MIT). See the LICENSE for details.