-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from PeteXC/upgrade-docs
docs: updated documentation for task syntax
- Loading branch information
Showing
9 changed files
with
216 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
title: "Dependencies" | ||
description: | ||
linkTitle: "Dependencies" | ||
menu: { main: { parent: 'task-syntax', weight: 10 } } | ||
--- | ||
|
||
## How to create a dependency between two tasks | ||
|
||
You can run another before the task you're trying to run as a dependency. | ||
|
||
For example, you want to run a task to deploy your code, but you want to run all the unit tests and linters before that happens. | ||
|
||
Before the command section of the task, you may define comma seperated dependencies with `requires:` or `req:` followed by the name of the tasks that are dependencies. | ||
|
||
````markdown | ||
## Tasks | ||
|
||
### Test | ||
``` | ||
sh test.sh | ||
``` | ||
|
||
### Lint | ||
``` | ||
sh lint.sh | ||
``` | ||
|
||
### Deploy | ||
requires: Test, Lint | ||
``` | ||
sh deploy.sh | ||
``` | ||
```` | ||
|
||
## Chaining tasks with dependencies | ||
|
||
You can chain tasks through the use of dependencies. | ||
|
||
````markdown | ||
## Tasks | ||
|
||
### Task1 | ||
``` | ||
echo "TASK 1" | ||
``` | ||
|
||
### Task2 | ||
requires: Task1 | ||
``` | ||
echo "TASK 2" | ||
``` | ||
|
||
### Task3 | ||
requires: Task2 | ||
``` | ||
echo "TASK 3" | ||
``` | ||
```` | ||
|
||
Running `xc Task3` will yield: | ||
|
||
``` | ||
echo "TASK 1" | ||
TASK 1 | ||
echo "TASK 2" | ||
TASK 2 | ||
echo "TASK 3" | ||
TASK 3 | ||
``` | ||
|
||
Running in the order of `Task1` -> `Task2` -> `Task` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters