Namespaces¶
Taskfiles¶
Rivet locates the root taskfile by searching up the file system for a root taskfile (i.e. a taskfile with no namespace node).
From there Rivet will automatically scan and load all namespaced taskfiles found under the root taskfile folder.
version: 42
namespace: project:util
tasks:
message:
cmds:
- cmd: echo "Hello World!"
Multi-doc Taskfiles¶
Taskfiles can also be combined into Multi-doc YAML files. The first non-namespaced taskfile will be used as the root taskfile.
---
version: 42
tasks:
default:
cmds:
- task: project:util:message
---
version: 42
namespace: project:util
tasks:
message:
cmds:
- cmd: echo "Hello World!"
Tasks¶
Root and Namespace Tasks¶
---
version: 42
tasks:
message:
cmds:
- cmd: echo "Hello from root task"
---
version: 42
namespace: tasks
tasks:
message:
cmds:
- cmd: echo "Hello from namespace task"
example:
cmds:
- task: message
- task: :message
rivet tasks:example
# Expected output:
Hello from namespace task
Hello from root task
Namespaced Tasks¶
---
version: 42
tasks:
default:
cmds:
- task: ::message
---
version: 42
namespace: some:tasks
tasks:
message:
cmds:
- cmd: echo "Hello from some namespace task"
---
version: 42
namespace: some:other:tasks
tasks:
message:
cmds:
- cmd: echo "Hello from other other namespace task"
rivet
# Expected output:
Hello from some namespace task
Hello from other namespace task
Merged Namespaces¶
---
version: 42
tasks:
default:
cmds:
- task: some:tasks:message
---
version: 42
namespace: some:tasks
vars:
ns: '{{NAMESPACE}}'
tasks:
message:
cmds:
- task: hello
- task: world
hello:
cmds:
- cmd: echo "Hello ({{ns}})"
---
version: 42
namespace: some:tasks
tasks:
world:
cmds:
- cmd: echo "World! ({{ns}})"
Variables¶
Global Variables¶
---
version: 42
vars:
message: Hello World!
tasks:
default:
cmds:
- task: tasks:message
---
version: 42
namespace: tasks
vars:
message: "Hello from namespace"
tasks:
world:
cmds:
- cmd: echo "{{:message}}"
- cmd: echo "{{message}}"
Namespaced Variables¶
---
version: 42
tasks:
default:
cmds:
- cmd: echo "{{tasks:message}}"
---
version: 42
namespace: tasks
vars:
message: Hello World!
Imports¶
version: 42
imports:
- uri: common/util
as: util
tasks:
default:
cmds:
- task: util:message
version: 42
tasks:
message:
cmds:
- cmd: echo "Hello World!"
Authentication¶
HTTPS¶
Planned: A .netrc style mechanism.
Git¶
Planned: Directly use the
gitexecutable and use (indirectly) its authentication.
Headers¶
Planned: Raw headers can be specified which are appended to any HTTP/HTTPS request.
version: 42
imports:
- uri: common/util
as: util
headers:
Authorization: "Bearer {{TOKEN}}"
Certificates¶
Certificates should be configured in the host operating system.
Variables¶
When importing a taskfile its possible to set variables in the imported taskfiles namespace. These variables will overwrite any variables with the same name in the imported taskfile.
version: 42
imports:
- uri: common/util
as: util
vars:
message: Hello World!
tasks:
default:
cmds:
- task: util:message