-
Notifications
You must be signed in to change notification settings - Fork 2
/
ron.yaml
120 lines (119 loc) · 3.1 KB
/
ron.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{{$path := "export PATH=$GOPATH/bin:$PATH"}}
{{$list := "$(go list ./... | grep -v vendor/ | grep -v '_/go')"}}
remotes:
staging:
-
host: example2.com
port: 22
user: test
proxy_host:
proxy_port:
proxy_user:
identity_file:
envs:
- APP: ron
- APP_UNDERSCORE: +echo $APP | tr "-" "_"
- ARCH: amd64
- CURDIR: +pwd
- UNAME: +uname | tr '[:upper:]' '[:lower:]'
- PACKAGE_VERSION: +git describe --always --dirty --tags | tr '-' '_'
- TAG: v1.1.3
- LATEST_URL: "https://github.com/upsight/ron/releases/download/$TAG/ron-${UNAME}-latest"
- REPO: github.com/upsight/ron
- RELEASES: linux darwin windows
targets:
echo:
cmd: |
echo $APP $HOME
prep:
description: Compile the default yaml asset to a go file.
cmd: |
go get -u github.com/jteeuwen/go-bindata/...
go-bindata -o target/default.go -pkg=target target/default.yaml
install:
description: Install ron to $GOPATH/bin
before:
- prep
- build
cmd: |
cp bin/${UNAME}_${ARCH}/$APP-${UNAME}-$TAG $GOPATH/bin/ron
build:
description: Compile a binary to ./bin/${UNAME}_${ARCH}
before:
- prep
cmd: |
set -x
mkdir -p bin/${UNAME}_${ARCH}
GOARCH=$ARCH GOOS=$UNAME go build -o bin/${UNAME}_${ARCH}/$APP-${UNAME}-$TAG -ldflags "-X $REPO.GitCommit=$PACKAGE_VERSION -X $REPO.AppVersion=$TAG -X $REPO.AppName=$APP" cmd/$APP/*.go
build_all:
description: Compile a binary to ./bin/linux_${ARCH} and ./bin/darwin_${ARCH}
before:
- prep
after:
- _build_msg
cmd: |
for os in $RELEASES; do
printf "building to bin/${os}_${ARCH}...\n"
mkdir -p bin/${os}_${ARCH}
UNAME=$os ron t build
done
lint:
description: Run golint
before:
- prep
cmd: |
for pkg in $(go list ./... | grep -v /vendor/); do
golint $pkg
done
vet:
description: Run go vet on ./src.
before:
- prep
cmd: |
go vet {{$list}}
test:
description: Run go test.
before:
- prep
after:
- lint
- vet
cmd: |
go test -cover {{$list}}
testv:
description: Run go test -v.
before:
- prep
after:
- lint
- vet
cmd: |
go test -v {{$list}}
cover:
description: Run go coverage and open a browser to show the heatmap.
before:
- prep
cmd: |
rm bin/coverage* || true
echo "mode: count" > bin/coverage.out
# run tests and create coverage profile
for pkg in $(go list ./... | grep -v /vendor/); do
go test -covermode=count -coverprofile=bin/coverage.out.tmp $pkg
tail -n +2 bin/coverage.out.tmp >> bin/coverage.out || true
rm bin/coverage.out.tmp || true
done
# check heatmap
go tool cover -html=bin/coverage.out
run:
description: go run the app with no arguments.
before:
- prep
cmd: |
go run cmd/ron/main.go
_vendor_update:
description: >
To update vendor packages run this. Assumes glide is installed.
brew install glide
cmd: |
{{$path}}
glide update --update-vendored --strip-vcs