-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathBUILD.yaml
106 lines (106 loc) · 3.02 KB
/
BUILD.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
packages:
- name: app
type: go
srcs:
- "cmd/**/*.go"
- "pkg/**/*.go"
- "main.go"
- "go.mod"
- "go.sum"
- "crd/*.yaml"
deps:
- components/common-go:lib
- components/content-service-api/go:lib
- components/content-service:lib
- components/ws-daemon-api/go:lib
- components/ws-manager-api/go:lib
- components/ws-manager-mk2:crd
env:
- CGO_ENABLED=0
- GOOS=linux
prep:
- ["mv", "_deps/components-ws-manager-mk2--crd/workspace.gitpod.io_workspaces.yaml", "crd/workspace.gitpod.io_workspaces.yaml"]
config:
packaging: app
buildCommand: ["go", "build", "-trimpath", "-ldflags=-buildid= -X 'github.com/gitpod-io/gitpod/ws-daemon/cmd.Version=commit-${__git_commit}'"]
- name: lib
type: go
srcs:
- "cmd/**/*.go"
- "pkg/**/*.go"
- "main.go"
- "go.mod"
- "go.sum"
- "crd/*.yaml"
deps:
- components/common-go:lib
- components/content-service-api/go:lib
- components/content-service:lib
- components/ws-daemon-api/go:lib
- components/ws-manager-api/go:lib
- components/ws-manager-mk2:crd
env:
- CGO_ENABLED=0
- GOOS=linux
prep:
- ["mv", "_deps/components-ws-manager-mk2--crd/workspace.gitpod.io_workspaces.yaml", "crd/workspace.gitpod.io_workspaces.yaml"]
config:
packaging: library
- name: content-initializer
type: go
srcs:
- "pkg/**/*.go"
- "cmd/content-initializer/**/*.go"
- "go.mod"
- "go.sum"
deps:
- components/common-go:lib
- components/content-service-api/go:lib
- components/content-service:lib
- components/ws-daemon-api/go:lib
- components/ws-manager-api/go:lib
env:
- CGO_ENABLED=0
- GOOS=linux
prep:
- ["mv", "cmd/content-initializer/main.go", "."]
config:
packaging: app
dontTest: true
buildCommand: ["go", "build", "-trimpath", "-ldflags", "-buildid= -w -s"]
- name: docker
type: docker
deps:
- :app
- :content-initializer
- components/ws-daemon/nsinsider:app
argdeps:
- imageRepoBase
srcs:
- default.gitconfig
config:
buildArgs:
VERSION: ${version}
dockerfile: leeway.Dockerfile
metadata:
helm-component: wsDaemon
image:
- ${imageRepoBase}/ws-daemon:${version}
- ${imageRepoBase}/ws-daemon:commit-${__git_commit}
scripts:
- name: kube-exec
description: Executes into the ws-daemon for a workspace pod in $WS
script: |-
if [ -z "$WS" ]; then
echo "usage: WS=<workspacePodName> leeway run components/ws-daemon:kube-exec"
exit 1
fi
node=$(kubectl get pod -o jsonpath='{.spec.nodeName}' $WS)
if [ -z "$node" ]; then
echo "did not find a node"
exit 1
fi
daemon=$(kubectl describe node $node | grep ws-daemon | grep $(kubens -c) | cut -d ' ' -f 4-30)
echo node: $node
echo daemon: $daemon
kubectl exec -it $daemon -- sh