max

Max is a YAML-based task runner.
Not tested on windows (yet, pull request?).
Check out the examples.
Installation
go get -u github.com/frozzare/max
or using homebrew.
brew install frozzare/tap/max
Usage
Running max help will print help output.
Task help
$ max help [task]
Usage:
max hello [name]
Summary:
Hello task
Configuration
The default task is default
Basic task
Config
tasks:
hello:
summary: Hello task
commands:
- echo Hello
Output
$ max hello
Hello
Task with arguments
Config
tasks:
hello:
args:
name: default
summary: Hello task
commands:
- echo Hello {{ .name }}
usage: "[--name]"
Output
$ max hello
Hello default
$ max hello --name max
Hello max
Task running other tasks
Config
tasks:
hello:
args:
name: default
summary: Hello task
commands:
- echo Hello {{ .name }}
default:
tasks:
- hello
Output
$ max
Hello default
$ max default --name max
Hello max
Task with global arguments
Config
args:
name: default
tasks:
hello:
summary: Hello task
commands:
- echo Hello {{ .name }}
Output
$ max hello
Hello default
$ max hello --name max
Hello max
Include task from other files.
Config max.yml
tasks:
hello: !include hello.yml
Config hello.yml
args:
name: default
summary: Hello task
commands:
- echo Hello {{ .name }}
Output
$ max hello
Hello default
$ max hello --name max
Hello max
Docker
Tasks can be runned in docker images, you need to configure docker for each tasks.
tasks:
build:
docker:
image: golang:1.10
volumes:
- .:/go/src/app
working_dir: /go/src/app
commands:
- go build -o main
Max file spec
The default file name is max.yml but you can specific another file by using the --config flag.
Other supported default files are:
max_windows.yml
max_linux.yml
max_darwin.yml
args: Global arguments that all tasks can use. Key/Value map that can be used with --key flag.
tasks:
task: task id (os specific tasks can be loaded before real task id, e.g build_windows is loaded when build is called on windows)
args: Arguments that all tasks can use. Key/Value map that can be used with --key flag.
deps: [task] # task dependencies, e.g [build, that]
dir: Custom directory to execute commands in. Default is where the max file is located.
docker:
entrypoint: docker entrypoint
image: docker image
volumes:
- single/multi-line array of docker volumes
working_dir: docker working directory
interval: task interval (cron format) (not required)
summary: task summary (not required)
tasks:
- single/multi-line array of tasks to run
- (not required)
commands:
- single/multi-line array of commands to run (go text template)
- access environment variables via $NAME
- (not required)
status:
- single/multi-line array of commands to run to test that the task is up to date.
- (test -e main)
usage: string of usage text, e.g "[--name]" (not required)
License
MIT © Fredrik Forsmo