Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Adding go 'getting-started' devfile #44

Merged
merged 1 commit into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions getting-started/go/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[![Contribute](https://che.openshift.io/factory/resources/factory-contribute.svg)](https://che.prod-preview.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/go/devfile.yaml)
75 changes: 75 additions & 0 deletions getting-started/go/devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
apiVersion: 1.0.0
metadata:
name: golang
attributes:
persistVolumes: 'false'
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
alias: go-plugin
memoryLimit: 512Mi
-
type: dockerimage
# this version is used in the plugin
image: quay.io/eclipse/che-golang-1.10:nightly
alias: go-cli
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
endpoints:
- name: '8080/tcp'
port: 8080
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: stop outyet
actions:
- type: exec
component: go-cli
command: kill $(pidof go)
-
name: test outyet
actions:
- type: exec
component: go-cli
command: go test
workdir: ${CHE_PROJECTS_ROOT}/src/github.com/golang/example/outyet
-
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}",
},
]
}