Taskfile
Taskfiles are a way to define tasks that can be run with the `task` command. They are written in YAML and can be used to automate common tasks such as building, testing, and deploying your application.
This guide is a work in progress and may contain incomplete or inaccurate information. Please refer to their website for the most up-to-date information: Taskfile.dev
Installation
These installation methods are maintained by the Task team and are always up-to-date.
Ubuntu
First setup the repository:
curl -1sLf 'https://dl.cloudsmith.io/public/task/task/setup.deb.sh' | sudo -E bashNext, install the package:
sudo apt install taskUsage
The following guide will help introduce you to the basics of Task. We'll cover how to create a Taskfile, how to write a basic task and how to call it.
Creating a Taskfile
To use Task, you need to create a Taskfile.yml in the root of your or you can run task --init to generate one for you. This file defines the tasks that you can run with the task command.
Calling a Task
To call a task, you can use the task command followed by the name of the task you want to run. For example, if you have a task called build, you can run it with the following command:
task buildSamples
Here are some sample Taskfiles to help you get started
Docker
version: '3'
tasks:
remove:
cmds:
- docker compose down --rmi all
silent: true
build:
cmds:
- docker compose build
silent: true
start:
cmds:
- docker compose up -d
silent: true
stop:
cmds:
- docker compose stop
silent: true
status:
cmds:
- docker compose ps
silent: true