Skip to content

Commit

Permalink
Release v0.1.0 (#76)
Browse files Browse the repository at this point in the history
* Additions in gitignore

* Change version

* Add build tasks and dist in the Dogfile

* Change Dog's Dogfile reference from README
  • Loading branch information
xsb committed Jul 8, 2016
1 parent c7bbef1 commit 438691c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 43 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/
dist/
*tar.gz
4 changes: 2 additions & 2 deletions DOGFILE_SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The task map accepts the following directives. Please note that directives marke

### task

Name of the task. A string made of lowercase characters (a-z), may contain hyphens (-).
Name of the task. A string made of lowercase characters (a-z), integers (0-9) and hyphens (-).

```yml
- task: mytask
Expand Down Expand Up @@ -138,7 +138,7 @@ We can also tag our most important tasks to be highlighted at the top of the lis
tags: top # Show this task at the top of the list
```
### env*
### env
Default values for environment variables can be provided in the Dogfile. They can be modified at execution time.
Expand Down
46 changes: 38 additions & 8 deletions Dogfile.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
- task: clean
description: Clean compiled binaries
run: rm -rf dist

- task: build
description: Build dog binary
pre: clean
description: Build dog binary for current platform
env:
- OUTPUT_PATH=dist/current
- REV=v0.1.0
run: |
[ -d bin ] || mkdir bin
go get -u ./...
go build -o bin/dog
go build \
-ldflags "-X main.Release=$REV -w" \
-o "${OUTPUT_PATH}/dog" \
.
- task: clean
description: Clean compiled binaries
run: rm -rf bin
- task: install-build-deps
description: Installs required dependencies for building dog
run: go get -u github.com/mitchellh/gox

- task: build-all
description: Build dog binary for all platforms
env:
- XC_ARCH=386 amd64
- XC_OS=linux darwin windows freebsd openbsd solaris
- REV=v0.1.0
pre:
- install-build-deps
- clean
run: |
gox \
-os="${XC_OS}" \
-arch="${XC_ARCH}" \
-ldflags "-X main.Release=$REV -w" \
-output "dist/{{.OS}}_{{.Arch}}/dog" \
.
- task: dist
description: Put all dist binaries in a compressed file
env: REV=v0.1.0
pre: build-all
run: tar zcvf dog-${REV}.tar.gz dist/

- task: run-test-dogfiles
description: Run all Tasks in testdata Dogfiles
Expand Down
32 changes: 2 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,12 @@

Dog is a command line application that executes tasks. It works in a similar way as GNU Make or ruby's Rake but it is a more generic task runner, not a build tool. It can be used as a layer on top of your Makefile or your shell scripts. Dog's default script syntax is `sh` but it also supports BASH, Python or Ruby so you can write your tasks in any language.

Roadmap for v0.1:

- [x] List and run tasks
- [x] Support multiple languages
- [x] Allow multiple Dogfiles per directory
- [x] Show status code after running a task
- [x] Pre-hooks and post-hooks
- [ ] Pass environment variables to tasks

## What is a Dogfile?

Dogfile is a specification that uses YAML to describe the tasks related to a project. We think that the Spec will be finished (no further breaking changes) by the v1.0 version of Dog.

- Read the [Dogfile Spec](https://github.com/dogtools/dog/blob/master/DOGFILE_SPEC.md)

This is Dog's own Dogfile.yml:

```yml
- task: build
description: Build dog binary
pre: clean
run: |
[ -d bin ] || mkdir bin
go get -u ./...
go build -o bin/dog
- task: clean
description: Clean compiled binaries
run: rm -rf bin

- task: run-test-dogfiles
description: Run all Tasks in testdata Dogfiles
run: ./scripts/test-dogfiles.sh
```
- Read [Dog's own Dogfile](https://github.com/dogtools/dog/blob/master/Dogfile.yml)

## Other tools

Expand All @@ -48,8 +20,8 @@ At this moment we are focused on implementing the basics that will allow us to p
If you want to help, take a look at:

- Open [bugs](https://github.com/dogtools/dog/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
- Lacking features for [v0.1.0](https://github.com/dogtools/dog/milestone/1)
- Lacking features for [v0.2.0](https://github.com/dogtools/dog/milestone/2)
- Lacking features for [v0.3.0](https://github.com/dogtools/dog/milestone/3)
- Our [Code of Conduct](https://github.com/dogtools/dog/blob/master/CODE_OF_CONDUCT.md)

In case you are not interested in improving Dog but on building your own tool on top of the Dogfile Spec, please help us discussing it:
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/joho/godotenv"
)

const version = "0.0"
const version = "v0.1.0"

func main() {
// if .env file exists (in same dir as Dogfile), load values into env
Expand Down
2 changes: 1 addition & 1 deletion parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func parseStringSlice(str interface{}) ([]string, error) {

// ParseDogfile takes a byte slice and process it to return a TaskMap.
func ParseDogfile(d []byte) (tm types.TaskMap, err error) {
const validTaskName = "^[a-z-]+$"
const validTaskName = "^[a-z0-9-]+$"
var tasksToParse []*task

err = yaml.Unmarshal(d, &tasksToParse)
Expand Down

0 comments on commit 438691c

Please sign in to comment.