forked from eclipse-che/che-machine-exec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devfile.yaml
144 lines (132 loc) · 3.83 KB
/
devfile.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
# Copyright (c) 2019-2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#
apiVersion: 1.0.0
metadata:
name: che-machine-exec
projects:
- name: che-machine-exec
source:
type: git
location: https://github.com/eclipse-che/che-machine-exec.git
components:
- alias: ms-vscode.go
id: golang/go/latest
type: chePlugin
memoryLimit: 1G
- alias: typescript-plugin
type: chePlugin
id: vscode/typescript-language-features/latest
memoryLimit: 512M
- alias: theia-dev-or-cloud-shell
type: dockerimage
image: quay.io/eclipse/che-theia-dev:next
mountSources: true
endpoints:
- name: theia-dev-or-cloud-shell
port: 3130
attributes:
protocol: http
secure: 'false'
public: 'true'
memoryLimit: 512M
- alias: dev
type: dockerimage
image: quay.io/eclipse/che-golang-1.14:next
mountSources: true
endpoints:
- name: exec-server
port: 5555
attributes:
type: terminal-dev
protocol: ws
secure: 'false'
public: 'true'
memoryLimit: 1024M
env:
- name: GOPATH
value: /go:$(CHE_PROJECTS_ROOT)
- name: GOCACHE
# replicate the GOCACHE from the plugin, even though the cache is not shared
# between the two
value: /tmp/.cache
commands:
- name: compile
actions:
- type: exec
component: dev
command: ./compile.sh
workdir: /projects/che-machine-exec
- name: test
actions:
- type: exec
component: dev
command: export CHE_WORKSPACE_ID=test_id; go test ./...
workdir: /projects/che-machine-exec
- name: format
actions:
- type: exec
component: dev
command: go fmt ./... && printf "\033[32mDone.\033[0m"
workdir: /projects/che-machine-exec
- name: start exec server
actions:
- type: exec
component: dev
command: ./che-machine-exec --url 0.0.0.0:5555
workdir: /projects/che-machine-exec
- name: stop exec server
actions:
- type: exec
component: dev
command: >-
pid=$(pidof che-machine-exec) && kill ${pid} &&
printf "\033[32mDone.\033[0m" ||
printf "\033[32mNothing to stop... Done.\033[0m"
- name: build cloud shell
actions:
- type: exec
command: yarn && yarn run build
component: theia-dev-or-cloud-shell
workdir: /projects/che-machine-exec/cloud-shell
- name: start cloud shell
actions:
- workdir: /projects/che-machine-exec
type: exec
command: >-
./che-machine-exec --url 0.0.0.0:3130 --static /projects/che-machine-exec/cloud-shell
component: dev
- name: Debug exec server
actions:
- type: vscode-launch
referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"useApiV1": false,
"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 1,
"maxStringLen": 3000,
"maxArrayValues": 100,
"maxStructFields": -1
},
"name": "Remote debug che-machine-exec",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/che-machine-exec/main.go",
"cwd": "${workspaceFolder}",
"args": [ "--url", "0.0.0.0:3130", "--static", "/projects/che-machine-exec/cloud-shell" ]
}
]
}