metadata:
  name: wksp-rfii
projects:
  - name: example
    source:
      location: >-
        https://devfile-registry-iokhrime-crw-tls.apps.ocp43.codereadyqe.com/resources/golang-example-master.zip
      type: zip
components:
  - id: ms-vscode/go/latest
    memoryLimit: 512Mi
    preferences:
      go.lintTool: golangci-lint
      go.lintFlags: '--fast'
    type: chePlugin
    alias: go-plugin
  - mountSources: true
    endpoints:
      - name: 8080-tcp
        port: 8080
    memoryLimit: 512Mi
    type: dockerimage
    image: >-
      quay.io/crw/stacks-golang-rhel8@sha256:f46f852c9cb50856b30161377b5fc7c5b2d388df5e68204304b654d244dc4f96
    alias: go-cli
    env:
      - value: '/go:$(CHE_PROJECTS_ROOT)'
        name: GOPATH
      - value: /tmp/.cache
        name: GOCACHE
apiVersion: 1.0.0
commands:
  - name: run outyet
    actions:
      - workdir: '${CHE_PROJECTS_ROOT}/example/outyet'
        type: exec
        command: go get -d && go run main.go
        component: go-cli
  - name: stop outyet
    actions:
      - type: exec
        command: kill $(pidof go)
        component: go-cli
  - name: test outyet
    actions:
      - workdir: '${CHE_PROJECTS_ROOT}/example/outyet'
        type: exec
        command: go test
        component: go-cli
  - name: run current file
    actions:
      - workdir: '${fileDirname}'
        type: exec
        command: 'go get -d && go run ${file}'
        component: go-cli
  - name: Debug current file
    actions:
      - referenceContent: |
          {
            "version": "0.2.0",
            "configurations": [
              {
                "name": "Debug current file",
                "type": "go",
                "request": "launch",
                "mode": "auto",
                "program": "${fileDirname}",
              },
            ]
          }
        type: vscode-launch

