-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
73 lines (58 loc) · 1.84 KB
/
Taskfile.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
version: "3"
tasks:
generate:
desc: "Generate code"
cmds:
- protoc --go_out=internal/pkg --go-grpc_out=internal/pkg internal/pkg/proto/greet.proto
compile-greet-server:
cmds:
- go build -a -o ./build/out/greetServer cmd/greetserver/main.go
compile-greet-client:
cmds:
- go build -a -o ./build/out/greetClient cmd/greetclient/main.go
deps:
cmds:
- go mod download
clean:
cmds:
- go clean -testcache
- rm -rf ./build/out
free-up-serverport:
cmds:
- sudo kill -9 $(sudo netstat -lnp | grep {{.serverport}} | awk '{print $NF}' | awk -F '/' '{print $1}')
vars:
serverport: 50051
package-greet-client:
deps: [compile-greet-client]
cmds:
- docker build --file build/Dockerfiles/Dockerfile.greetClient -t hiteshpattanayak/greet-client:4.0 .
publish-greet-client:
deps: [package-greet-client]
cmds:
- docker push hiteshpattanayak/greet-client:4.0
package-greet-server:
cmds:
- docker build --file build/Dockerfiles/Dockerfile.greetServer -t hiteshpattanayak/greet-server:1.0 .
publish-greet-server:
deps: [package-greet-server]
cmds:
- docker push hiteshpattanayak/greet-server:1.0
run-greet-server-cmd:
deps: [compile-greet-server]
cmds:
- ./build/out/greetServer
run-greet-client-cmd:
deps: [compile-greet-client]
cmds:
- ./build/out/greetClient
run-greet-server-k8s:
deps: [publish-greet-server]
cmds:
- kubectl run greetserver --image=hiteshpattanayak/greet-server:1.0 --restart=Never
run-greet-client-k8s:
deps: [publish-greet-client]
cmds:
- kubectl run greetclient --image=hiteshpattanayak/greet-client:1.0 --restart=Never
get-dns-name-of-svc:
cmds:
- kubectl exec greetclient -- nslookup greetserver | grep Name | awk -F ':' '{print $1}'