DOC_INDEX
THEME
From Task
Translate a go-task Taskfile.yml into an OrchStep workflow - tasks, cmds, deps, vars, and Go template interpolation.
If you use Task (go-task) with a Taskfile.yml, OrchStep
is the closest cousin of all the runners: both are YAML, both use Go templates,
and tasks: is literally the same top-level key. The migration is mostly a
search-and-replace on how variables are referenced, plus deciding whether
dependencies should stay parallel or become ordered.
The 30-second version
task build -> orchstep run build
task --list -> orchstep list-tasks
task deploy VERSION=2.1.0 ENVIRONMENT=prod -> orchstep run deploy --var version=2.1.0 --var environment=prodHow the concepts map
| Task | OrchStep |
|---|---|
tasks: | tasks: (same key) |
cmds: | steps: (func: shell with do:) |
deps: (runs in parallel) | A parallel: block (or sequential task: steps for ordering) |
vars: | defaults: |
{{.VAR}} (dot-rooted Go template) | {{ vars.VAR }} |
preconditions: | An assert step |
task --output | orchstep run --output |
Side by side
TASKFILE.YML
version: '3'
vars:
VERSION: "1.0.0"
ENVIRONMENT: "staging"
tasks:
build:
cmds:
- echo "building v{{.VERSION}}"
test:
cmds:
- echo "running tests"
deploy:
cmds:
- echo "deploying v{{.VERSION}} to {{.ENVIRONMENT}}"
ci:
deps: [test, build]ORCHSTEP.YML
name: app
desc: Build, test, and deploy the app
defaults:
version: "1.0.0"
environment: "staging"
tasks:
build:
steps:
- name: compile
func: shell
do: echo "building v{{ vars.version }}"
test:
steps:
- name: unit
func: shell
do: echo "running tests"
deploy:
steps:
- name: ship
func: shell
do: echo "deploying v{{ vars.version }} to {{ vars.environment }}"
ci: # deps become task calls
steps:
- name: run_test
task: test
- name: run_build
task: buildRun it
orchstep run build
orchstep run deploy --var environment=production --var version=2.1.0$ orchstep run deploy --var environment=production --var version=2.1.0
$ echo "deploying v2.1.0 to production"
deploying v2.1.0 to production
Result: successTask's task deploy VERSION=2.1.0 ENVIRONMENT=prod becomes the explicit
--var version=2.1.0 --var environment=prod. List everything with
orchstep list-tasks.
Gotchas worth knowing
{{.VAR}}becomes{{ vars.VAR }}. This is the main change: Task roots its template at the dot, OrchStep namespaces values undervars.deps:run in parallel by default. To keep that behavior, use aparallel:block; if you actually wanted ordering, use sequentialtask:steps (as shown in thecitask above).- Each
cmds:entry is a step. A list of commands undercmds:becomes a list of named steps, so you get per-step status and--dry-run. envis reserved. Don't name a variableenv- that namespace is for environment variables ({{ env.PATH }}). Useenvironment(the loader will stop you with a clear error otherwise).
What you gain
orchstep run --dry-runpreviews the whole chain (includingci->test/build).- Steps pass typed outputs instead of echoing strings.
- Per-step status and ordering control instead of all-parallel
deps:. - Shared tasks can become versioned modules.
Where to go next
- Composing Tasks - how
task:calls andparallel:blocks work. - Variables and Outputs - the
{{ vars.VAR }}namespace in depth. - CLI Reference - every flag for
orchstep run.