mirror of
https://github.com/go-task/task.git
synced 2024-12-12 10:45:49 +02:00
On documentation: version: '2' -> version: '3'
This commit is contained in:
parent
6ff3c9015b
commit
6f290f28b6
@ -56,7 +56,7 @@ tasks:
|
||||
|
||||
```yaml
|
||||
# bad
|
||||
version: 2
|
||||
version: '3'
|
||||
includes:
|
||||
docker: ./docker/Taskfile.yml
|
||||
output: prefixed
|
||||
@ -70,7 +70,7 @@ tasks:
|
||||
|
||||
|
||||
# good
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
includes:
|
||||
docker: ./docker/Taskfile.yml
|
||||
@ -92,7 +92,7 @@ tasks:
|
||||
|
||||
```yaml
|
||||
# bad
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
foo:
|
||||
@ -107,7 +107,7 @@ tasks:
|
||||
|
||||
|
||||
# good
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
foo:
|
||||
@ -127,7 +127,7 @@ tasks:
|
||||
|
||||
```yaml
|
||||
# bad
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
binary_name: myapp
|
||||
@ -139,7 +139,7 @@ tasks:
|
||||
|
||||
|
||||
# good
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
BINARY_NAME: myapp
|
||||
@ -154,7 +154,7 @@ tasks:
|
||||
|
||||
```yaml
|
||||
# bad
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
greet:
|
||||
@ -163,7 +163,7 @@ tasks:
|
||||
|
||||
|
||||
# good
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
greet:
|
||||
@ -177,7 +177,7 @@ This convention is also used by most people for any Go templating.
|
||||
|
||||
```yaml
|
||||
# bad
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
do_something_fancy:
|
||||
@ -186,7 +186,7 @@ tasks:
|
||||
|
||||
|
||||
# good
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
do-something-fancy:
|
||||
@ -198,7 +198,7 @@ tasks:
|
||||
|
||||
```yaml
|
||||
# good
|
||||
version: 2
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
docker:build:
|
||||
|
@ -8,7 +8,7 @@ The example below allows compiling a Go app and uses [Minify][minify] to concat
|
||||
and minify multiple CSS files into a single one.
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -40,7 +40,7 @@ If you omit a task name, "default" will be assumed.
|
||||
You can use `env` to set custom environment variables for a specific task:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
greet:
|
||||
@ -54,7 +54,7 @@ Additionally, you can set globally environment variables, that'll be available
|
||||
to all tasks:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
env:
|
||||
GREETING: Hey, there!
|
||||
@ -102,7 +102,7 @@ Example:
|
||||
Taskfile.yml:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -113,7 +113,7 @@ tasks:
|
||||
Taskfile_linux.yml:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -138,7 +138,7 @@ If you want to share tasks between different projects (Taskfiles), you can use
|
||||
the importing mechanism to include other Taskfiles using the `includes` keyword:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
includes:
|
||||
docs: ./documentation # will look for ./documentation/Taskfile.yml
|
||||
@ -179,7 +179,7 @@ located. But you can easily make the task run in another folder informing
|
||||
`dir`:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
serve:
|
||||
@ -201,7 +201,7 @@ You may have tasks that depend on others. Just pointing them on `deps` will
|
||||
make them run automatically before running the parent task:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -220,7 +220,7 @@ In the above example, `assets` will always run right before `build` if you run
|
||||
A task can have only dependencies and no commands to group tasks together:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
assets:
|
||||
@ -245,7 +245,7 @@ If you want to pass information to dependencies, you can do that the same
|
||||
manner as you would to [call another task](#calling-another-task):
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
default:
|
||||
@ -269,7 +269,7 @@ often result in a faster build pipeline. But in some situations you may need
|
||||
to call other tasks serially. In this case, just use the following syntax:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
main-task:
|
||||
@ -291,7 +291,7 @@ Overriding variables in the called task is as simple as informing `vars`
|
||||
attribute:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
main-task:
|
||||
@ -320,7 +320,7 @@ If a task generates something, you can inform Task the source and generated
|
||||
files, so Task will prevent to run them if not necessary.
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -356,7 +356,7 @@ You will probably want to ignore the `.task` folder in your `.gitignore` file
|
||||
(It's there that Task stores the last checksum).
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -377,7 +377,7 @@ Alternatively, you can inform a sequence of tests as `status`. If no error
|
||||
is returned (exit status 0), the task is considered up-to-date:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
generate-files:
|
||||
@ -422,7 +422,7 @@ conditions to be _true_ you can use the `preconditions` stanza.
|
||||
expansion and they SHOULD all return 0.
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
generate-files:
|
||||
@ -450,7 +450,7 @@ executing tasks that depend on it, a `precondition` will fail a task, along
|
||||
with any other tasks that depend on it.
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
tasks:
|
||||
task_will_fail:
|
||||
preconditions:
|
||||
@ -496,7 +496,7 @@ $ task write-file FILE=file.txt "CONTENT=Hello, World!" print "MESSAGE=All done!
|
||||
Example of locally declared vars:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
print-var:
|
||||
@ -509,7 +509,7 @@ tasks:
|
||||
Example of global vars in a `Taskfile.yml`:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
vars:
|
||||
GREETING: Hello from Taskfile!
|
||||
@ -535,7 +535,7 @@ Variables are expanded 2 times by default. You can change that by setting the
|
||||
variables together:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
expansions: 3
|
||||
|
||||
@ -559,7 +559,7 @@ The value will be treated as a command and the output assigned. If there is one
|
||||
or more trailing newlines, the last newline will be trimmed.
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -581,7 +581,7 @@ All functions by the Go's [slim-sprig lib](https://go-task.github.io/slim-sprig/
|
||||
are available. The following example gets the current date in a given format:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
print-date:
|
||||
@ -607,7 +607,7 @@ Task also adds the following functions:
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
print-os:
|
||||
@ -635,7 +635,7 @@ Running `task --list` (or `task -l`) lists all tasks with a description.
|
||||
The following Taskfile:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
build:
|
||||
@ -670,7 +670,7 @@ Running `task --summary task-name` will show a summary of a task.
|
||||
The following Taskfile:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
release:
|
||||
@ -739,7 +739,7 @@ Silent mode disables echoing of commands before Task runs it.
|
||||
For the following Taskfile:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
echo:
|
||||
@ -765,7 +765,7 @@ There are four ways to enable silent mode:
|
||||
* At command level:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
echo:
|
||||
@ -777,7 +777,7 @@ tasks:
|
||||
* At task level:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
echo:
|
||||
@ -789,7 +789,7 @@ tasks:
|
||||
* Globally at Taskfile level:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
silent: true
|
||||
|
||||
@ -804,7 +804,7 @@ tasks:
|
||||
If you want to suppress STDOUT instead, just redirect a command to `/dev/null`:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
echo:
|
||||
@ -823,7 +823,7 @@ You have the option to ignore errors during command execution.
|
||||
Given the following Taskfile:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
echo:
|
||||
@ -836,7 +836,7 @@ Task will abort the execution after running `exit 1` because the status code `1`
|
||||
However it is possible to continue with execution using `ignore_error`:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
echo:
|
||||
@ -867,7 +867,7 @@ options you can choose:
|
||||
To choose another one, just set it to root in the Taskfile:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
output: 'group'
|
||||
|
||||
@ -884,7 +884,7 @@ tasks:
|
||||
with the `prefix:` attribute:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
output: prefixed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user