Skip to content

Commit

Permalink
Initial commit of v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mizzy committed Sep 14, 2016
0 parents commit 555e253
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin/
vendor/

30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
NAME := walter
VERSION := $(shell git describe --tags --abbrev=0)
REVISION := $(shell git rev-parse --short HEAD)
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.revision=$(REVISION)'

setup:
go get github.com/Masterminds/glide
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/goimports

deps: setup
glide install

test: deps
go test $$(glide novendor)

lint: setup
go vet $$(glide novendor)
for pkg in $$(glide novendor -x); do \
golint -set_exit_status $$pkg || exit $$?; \
done

fmt: setup
goimports -w $$(glide nv -x)

build: test
go build -ldflags "$(LDFLAGS)" -o bin/$(NAME)

clean:
rm bin/$(NAME)
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Walter v2

## pipeline.yml

TBD

4 changes: 4 additions & 0 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package: github.com/walter-cd/walter
import: []
26 changes: 26 additions & 0 deletions lib/pipeline/pipeline.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package pipeline

import (
"github.com/go-yaml/yaml"
"github.com/walter-cd/walter-v2/lib/stage"
)

type Pipeline struct {
Pipeline []stage.Stage
}

func Load(y string) (Pipeline, error) {
p := Pipeline{}
err := yaml.Unmarshal([]byte(y), &p)
return p, err
}

/*
func LoadFromFile(file string) (Pipeline error) {
}
*/

func (p Pipeline) Run() {

}
21 changes: 21 additions & 0 deletions lib/pipeline/pipeline_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package pipeline

import "testing"

func TestLoad(t *testing.T) {
yaml := `
pipeline:
- name: command_stage_1
command: echo "hello, world"
- name: command_stage_2
command: echo "hello, world, command_stage_2"
- name: command_stage_3
command: echo "hello, world, command_stage_3"
`
_, err := Load(yaml)

if err != nil {
t.Fatal(err)
}

}
6 changes: 6 additions & 0 deletions lib/stage/stage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package stage

type Stage struct {
Name string
Command string
}
1 change: 1 addition & 0 deletions lib/stage/stage_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package stage
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package main

func main() {

}
1 change: 1 addition & 0 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package main

0 comments on commit 555e253

Please sign in to comment.