You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.3 KiB
66 lines
2.3 KiB
apiVersion: 1.0.0
|
|
metadata:
|
|
name: test-crw
|
|
projects:
|
|
- name: golang-health-check
|
|
source:
|
|
location: 'https://github.com/nmasse-itix/crw-sample-app.git'
|
|
type: git
|
|
branch: master
|
|
components:
|
|
- id: golang/go/latest
|
|
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
|
|
alias: go-cli
|
|
image: 'registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:ef135a05399a4d5f58bcb059b6634498bee5adbbcf8ddb2956abf25819e82462'
|
|
env:
|
|
- value: '/projects/.che/gopath:$(CHE_PROJECTS_ROOT)'
|
|
name: GOPATH
|
|
- value: '/projects/.che/gopath/bin:$(CHE_PROJECTS_ROOT)/bin:/home/jboss/.local/bin:/home/jboss/bin:/usr/share/Modules/bin:/usr/bin:/usr/bin:/home/jboss/go/bin:/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
|
name: PATH
|
|
- value: /tmp/.cache
|
|
name: GOCACHE
|
|
commands:
|
|
- name: 1. Build the application
|
|
actions:
|
|
- workdir: '${CHE_PROJECTS_ROOT}/golang-health-check'
|
|
type: exec
|
|
command: echo "Pre-requisites..." ; if [ -f tools.go ]; then go install -v $(go list -f '{{join .Imports " "}}' tools.go); fi; echo "Code generation..."; go generate ./... ; echo "Compilation..." ; go build
|
|
component: go-cli
|
|
- name: 2. Run the application
|
|
actions:
|
|
- workdir: '${CHE_PROJECTS_ROOT}/golang-health-check'
|
|
type: exec
|
|
command: ./golang-health-check
|
|
component: go-cli
|
|
- name: 3. Build and deploy in OpenShift
|
|
actions:
|
|
- workdir: '${CHE_PROJECTS_ROOT}/golang-health-check'
|
|
type: exec
|
|
command: oc process -f .openshiftio/application.yaml -p SOURCE_REPOSITORY_URL=https://github.com/nmasse-itix/crw-sample-app.git | oc apply -f -
|
|
component: go-cli
|
|
- name: Debug configuration
|
|
actions:
|
|
- referenceContent: |
|
|
{
|
|
"version": "0.2.0",
|
|
"configurations": [
|
|
{
|
|
"name": "Debug current file",
|
|
"type": "go",
|
|
"request": "launch",
|
|
"mode": "auto",
|
|
"program": "${fileDirname}"
|
|
}
|
|
]
|
|
}
|
|
type: vscode-launch
|
|
|