apiVersion: 1.0.0
metadata:
 generateName: golang-
projects:
 -
  name: example
  source:
   type: zip
   location: 'http://172.30.100.250:8080/resources/golang-example-master.zip'
components:
 -
  type: chePlugin
  id: ms-vscode/go/latest
  alias: go-plugin
  memoryLimit: 512Mi
  preferences:
   go.lintTool: golangci-lint
   go.lintFlags: '--fast'
 -
  type: dockerimage
  image: >-
   quay.io/crw/stacks-golang-rhel8@sha256:b6c48be8560ac6b5e07cb607ba97dc6df8e8907edcae8d244a31f05db50033bb
  alias: go-cli
  env:
   -
    name: GOPATH
    value: '/go:$(CHE_PROJECTS_ROOT)'
   -
    name: GOCACHE
    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: 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}",
         },
       ]
     }

