Dog & the Dogfile Spec
by Xavi Soler
@xavi_xsb
Dog
is a command line application
that executes tasks
$ dog
build Build dog binary for current platform
build-all Build dog binary for all platforms
clean Clean compiled binaries
dist Put all dist binaries in a compressed file
install-build-deps Installs required dependencies for building dog
run-test-dogfiles Run all Tasks in testdata Dogfiles
Dog
Dog
is not a built tool
Dog
executes automated tasks:
build, install, test, deploy, run scripts,
config/infra management,
automation in general
Dog
can provide environment variables
or arguments to tasks
Dog
knows about tasks
described in a Dogfile
Dogfile
is a specification that
describes tasks for a project
- task: clean
description: Clean compiled binaries
run: rm -rf dist
- task: build
description: Build dog binary for current platform
env:
- OUTPUT_PATH=dist/current
- REV=v0.1.0
run: |
go build \
-ldflags "-X main.Release=$REV -w" \
-o "${OUTPUT_PATH}/dog" \
.
- task: run-test-dogfiles
description: Run all Tasks in testdata Dogfiles
run: ./scripts/test-dogfiles.sh
Dogfile
Dogfile
uses YAML
(a Dogfile is an array of task objects)
Tasks in a Dogfile
can execute other tasks as
pre-hooks or post-hooks
Tasks in a Dogfile
can define their own workdir
Tasks in a Dogfile
can be written in any
interpreted language
(default is sh)
Tasks in a Dogfile
Directives: task, description, run,
pre, post, env, workdir, exec
Non standard directives:
anything starting with x_
Dogfile Spec
https://github.com/dogtools/dog/blob/master/DOGFILE_SPEC.md
Dog Story
idea was developed during
an intense weekend
Dog Story
started at Typeform Open Source days (but not a Typeform project)
Dog Story
join us on GitHub!
Future
registers
Future
parameters
Future
interactivity
Future
more tools!
Future
dog-serve, dog-bot,
web UI, vim-dog, JS lib,
bash/zsh autocomplete,
<add-your-idea-here>
?
Dogfile is a way to describe
tasks related to a project
and expose them to certain tools
?
Dog is the first dogtool,
a command line interface and
the reference implementation
Thanks!
go get github.com/dogtools/dog
Dog & the Dogfile Spec
By xsb
Dog & the Dogfile Spec
- 1,704