Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Adds an example project to go devfile. #13

Merged
merged 4 commits into from
Jul 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 45 additions & 18 deletions devfiles/go/devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,49 @@
apiVersion: 1.0.0
metadata:
name: golang
projects:
-
name: example
source:
type: git
location: /~https://github.com/golang/example.git
clonePath: src/github.com/golang/example/
components:
-
type: chePlugin
id: ms-vscode/go/latest
memoryLimit: 512Mi
-
type: dockerimage
image: golang:1.12.4-stretch
command: ['sleep']
args: ['infinity']
env:
- name: GOPATH
value: /go:/projects
- name: GOCACHE
value: /tmp/.cache
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 512Mi
mountSources: true
-
type: chePlugin
id: ms-vscode/go/latest
alias: go-plugin
memoryLimit: 512Mi
-
type: dockerimage
# this version is used in the plugin
image: golang:1.10.7-stretch
alias: go-cli
command: ['sleep']
args: ['infinity']
env:
- name: GOPATH
# replicate the GOPATH from the plugin
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
- name: PS1
value: $(echo ${0})\\$
memoryLimit: 512Mi
mountSources: true
commands:
-
name: run outyet
actions:
- type: exec
component: go-cli
command: go get -d && go run main.go
workdir: ${CHE_PROJECTS_ROOT}/src/github.com/golang/example/outyet
- name: test outyet
actions:
- type: exec
component: go-cli
command: go test
workdir: ${CHE_PROJECTS_ROOT}/src/github.com/golang/example/outyet