This repository was archived by the owner on Aug 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
139 lines (119 loc) · 3.67 KB
/
Taskfile.yml
File metadata and controls
139 lines (119 loc) · 3.67 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
version: '2'
vars:
Dir:
sh: basename "$PWD"
Version:
sh: git rev-parse HEAD
Boulder:
sh: echo $GOPATH/src/github.com/letsencrypt/boulder
tasks:
default:
cmds:
- task: run
run:
desc: Run the glorious app.
cmds:
- task: build/server
- ./bin/{{.Dir}}_server_{{exeExt}}
clean:
desc: Cleanup the build artifacts.
cmds:
- echo "Cleaning ..."
- rm -rf bin/ *.html *.out | exit 0;
install:
desc: Install all dependencies.
cmds:
- echo "Installing Dependencies ..."
- go get -u github.com/tcnksm/ghr
- go get -u github.com/mitchellh/gox
- go get -u github.com/alecthomas/gometalinter
- go get -u github.com/kisielk/errcheck
test:
desc: Run all the go tests.
cmds:
- go test -v -race ./...
run/boulder:
desc: Integration test.
deps: [build]
cmds:
- docker run --ip 10.77.77.78 -p 8888:8888 -p 8080:5002 -p 8443:5001 -v $PWD/bin/outlaw_linux_amd64:/bin/outlaw --network boulder_bluenet golang:1.11.2 outlaw --acme-url http://boulder:4000/directory --bootstrap --mongo --mongo-endpoint mongo --mongo-username root --mongo-password example --mongo-auth-database admin --verbose --http-port 5002 --https-port 5001
cov:
desc: Generate test converage.
cmds:
- go test -v -cover -coverprofile=c.out
- go tool cover -html=c.out -o coverage.html
vet:
desc: Reports suspicious code.
cmds:
- go vet ./...
lint:
desc: Run all the linters.
cmds:
- gometalinter --disable-all --enable=errcheck --enable=vet --enable=vetshadow ./...
ci:
desc: Run it like Volkswagen.
cmds:
- task: test
- task: lint
gen-proto:
desc: Generate protobuf client/server & cmd
cmds:
- mkdir -p bin/gen
- mkdir -p bin/cli
- protoc --go_out=plugins=grpc:./proto --proto_path=proto proto/*.proto
build:
desc: Builds all binaries.
generates:
- bin/*.{{exeExt}}
cmds:
- task: build/server
- task: build/client
build/client:
desc: Build client binaries.
sources:
- ./*.go
generates:
- bin/*.{{exeExt}}
cmds:
- echo "Building ({{.Dir}}) ..."
- mkdir -p bin
- gox -output {{printf "bin/{{.Dir}}_{{.OS}}_{{.Arch}}"}} -ldflags "-X version.Version={{.Version}}" -os="linux" -os="darwin" -arch="386" -arch="amd64" ./cli
- go build -i -o bin/{{.Dir}}
build/server:
desc: Build server binaries.
sources:
- ./*.go
generates:
- bin/*.{{exeExt}}
cmds:
- echo "Building ({{.Dir}}) ..."
- mkdir -p bin
- gox -output {{printf "bin/{{.Dir}}_{{.OS}}_{{.Arch}}"}} -ldflags "-X version.Version={{.Version}}" -os="linux" -os="darwin" -arch="386" -arch="amd64" ./
- go build -i -o bin/{{.Dir}}
boulder/setup:
desc: Setup Boulder.
cmds:
- rm -rf {{.Boulder}}
- git clone --depth 1 https://github.com/letsencrypt/boulder.git {{.Boulder}} 2> /dev/null
- sed -i -e 's/--http01 ""/--http01 :5002/' {{.Boulder}}/test/startservers.py
- sed -i -e 's/test\/config$$/test\/config-next/' {{.Boulder}}/docker-compose.yml
boulder/start:
desc: Start Boulder.
cmds:
- docker-compose -f {{.Boulder}}/docker-compose.yml run --use-aliases -e FAKE_DNS=10.77.77.78 --service-ports boulder ./start.py
boulder/stop:
desc: Stop Boulder.
cmds:
- docker-compose -f {{.Boulder}}/docker-compose.yml down
docker:
desc: Build docker.
deps: [release]
cmds:
- docker build --build-arg BIN={{.Dir}} -t {{.Dir}}:latest .
release:
desc: Release the glorious app.
deps: [clean]
generates:
- bin/*.{{exeExt}}
cmds:
- task: build