This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathdevfile.yaml
118 lines (117 loc) · 2.7 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
---
apiVersion: 1.0.0
metadata:
generateName: golang-
projects:
-
name: example
source:
type: git
location: https://github.com/che-samples/golang-example
clonePath: src/github.com/che-samples/example
-
name: golang-echo-example
source:
type: git
location: https://github.com/che-samples/golang-echo-example
clonePath: src/github.com/che-samples/golang-echo-example
components:
-
type: chePlugin
id: golang/go/latest
alias: go-plugin
preferences:
go.lintTool: 'golangci-lint'
go.lintFlags: '--fast'
go.useLanguageServer: true
-
type: dockerimage
# this version is used in the plugin
image: quay.io/eclipse/che-golang-1.17:bc5a495
alias: go-cli
env:
- name: GOPATH
# replicate the GOPATH from the plugin
value: $(CHE_PROJECTS_ROOT)
- name: GOCACHE
# replicate the GOCACHE from the plugin, even though the cache is not shared
# between the two
value: /tmp/.cache
endpoints:
- name: '8080-tcp'
port: 8080
memoryLimit: 2Gi
mountSources: true
commands:
-
name: '1.1 Run outyet'
actions:
- type: exec
component: go-cli
command: go get -d && go run main.go
workdir: ${CHE_PROJECTS_ROOT}/src/github.com/che-samples/example/outyet
-
name: '1.2 Stop outyet'
actions:
- type: exec
component: go-cli
command: kill $(pidof go)
-
name: '1.3 Test outyet'
actions:
- type: exec
component: go-cli
command: go test
workdir: ${CHE_PROJECTS_ROOT}/src/github.com/che-samples/example/outyet
-
name: '2.1 xenisa :: install dependencies'
actions:
- type: exec
component: go-cli
command: go mod download
workdir: ${GOPATH}/src/github.com/che-samples/golang-echo-example
-
name: '2.2 xenisa :: run'
actions:
- type: exec
component: go-cli
command: go run main.go
workdir: ${GOPATH}/src/github.com/che-samples/golang-echo-example
-
name: '2.3 xenisa :: build'
actions:
- type: exec
component: go-cli
command: go build
workdir: ${GOPATH}/src/github.com/che-samples/golang-echo-example
-
name: '2.4 xenisa :: test'
actions:
- type: exec
component: go-cli
command: go test ./...
workdir: ${GOPATH}/src/github.com/che-samples/golang-echo-example
-
name: 'Run current file'
actions:
- type: exec
component: go-cli
command: go get -d && go run ${file}
workdir: ${fileDirname}
-
name: 'Debug current file'
actions:
- type: vscode-launch
referenceContent: |
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug current file",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
}
]
}