mirror of
https://github.com/go-task/task.git
synced 2024-12-12 10:45:49 +02:00
docs: added usage
This commit is contained in:
parent
3507fa40f1
commit
d3da086ebf
@ -194,6 +194,21 @@ tasks:
|
|||||||
- echo "This command can still be successfully executed if ./tests/Taskfile.yml does not exist"
|
- echo "This command can still be successfully executed if ./tests/Taskfile.yml does not exist"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Internal includes
|
||||||
|
|
||||||
|
Includes marked as internal will set all the tasks of the included file to be
|
||||||
|
internal as well (See the [Internal Tasks](#internal-tasks) section below). This is useful when including utility tasks that are not
|
||||||
|
intended to be used directly by the user.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
includes:
|
||||||
|
tests:
|
||||||
|
taskfile: ./taskfiles/Utils.yml
|
||||||
|
internal: true
|
||||||
|
```
|
||||||
|
|
||||||
### Vars of included Taskfiles
|
### Vars of included Taskfiles
|
||||||
|
|
||||||
You can also specify variables when including a Taskfile. This may be useful
|
You can also specify variables when including a Taskfile. This may be useful
|
||||||
@ -223,6 +238,30 @@ use the [default function](https://go-task.github.io/slim-sprig/defaults.html):
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
## Internal Tasks
|
||||||
|
|
||||||
|
Internal tasks are tasks that cannot be called directly by the user. They will
|
||||||
|
not appear in the output when running `task --list|--list-all`. Other tasks may
|
||||||
|
call internal tasks in the usual way. This is useful for creating reusable,
|
||||||
|
function-like tasks that have no useful purpose on the command line.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
build-image-1:
|
||||||
|
cmds:
|
||||||
|
- task: build-image
|
||||||
|
vars:
|
||||||
|
DOCKER_IMAGE: image-1
|
||||||
|
|
||||||
|
build-image:
|
||||||
|
internal: true
|
||||||
|
cmds:
|
||||||
|
- docker build -t {{.DOCKER_IMAGE}} .
|
||||||
|
```
|
||||||
|
|
||||||
## Task directory
|
## Task directory
|
||||||
|
|
||||||
By default, tasks will be executed in the directory where the Taskfile is
|
By default, tasks will be executed in the directory where the Taskfile is
|
||||||
|
Loading…
Reference in New Issue
Block a user