109 lines
3.8 KiB
YAML
109 lines
3.8 KiB
YAML
#
|
|
# Copyright (c) 2019-2021 Red Hat, Inc.
|
|
# This program and the accompanying materials are made
|
|
# available under the terms of the Eclipse Public License 2.0
|
|
# which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
#
|
|
# SPDX-License-Identifier: EPL-2.0
|
|
#
|
|
# Contributors:
|
|
# Red Hat, Inc. - initial API and implementation
|
|
#
|
|
schemaVersion: 2.1.0
|
|
attributes:
|
|
controller.devfile.io/storage-type: ephemeral
|
|
metadata:
|
|
name: che-operator
|
|
components:
|
|
- name: tooling-container
|
|
container:
|
|
image: quay.io/devfile/universal-developer-image:ubi8-latest
|
|
memoryRequest: 2Gi
|
|
memoryLimit: 16Gi
|
|
cpuRequest: 2000m
|
|
cpuLimit: 6000m
|
|
env:
|
|
- name: GO111MODULE
|
|
value: 'on'
|
|
- name: GOPATH
|
|
value: /home/user/go
|
|
- name: GOCACHE
|
|
value: /tmp/.cache
|
|
- name: IMAGE_TOOL
|
|
value: podman
|
|
- name: KUBECONFIG
|
|
value: /home/user/.kube/config
|
|
commands:
|
|
- id: install-go-1-18
|
|
exec:
|
|
label: POST START EVENT - Install go 1.18
|
|
component: tooling-container
|
|
commandLine: |
|
|
cd /tmp && wget https://go.dev/dl/go1.18.6.linux-amd64.tar.gz && \
|
|
mkdir $HOME/go1.18 && \
|
|
tar -xvzf go1.18.6.linux-amd64.tar.gz -C $HOME/go1.18 --strip-components 1 && \
|
|
if ! grep -q "export PATH=\$HOME/go1.18/bin:\$PATH" $HOME/.bashrc; then echo "export PATH=\$HOME/go1.18/bin:\$PATH" >> $HOME/.bashrc; fi
|
|
- id: install-chectl
|
|
exec:
|
|
label: POST START EVENT - Install chectl
|
|
component: tooling-container
|
|
commandLine: |
|
|
tag=$(curl https://api.github.com/repos/che-incubator/chectl/tags | jq -r '.[0].name') && \
|
|
cd /tmp && wget https://github.com/che-incubator/chectl/releases/download/${tag}/chectl-linux-x64.tar.gz && \
|
|
mkdir $HOME/chectl && \
|
|
tar -xvzf chectl-linux-x64.tar.gz -C $HOME/chectl --strip-components 1 && \
|
|
if ! grep -q "export PATH=\$HOME/chectl/bin:\$PATH" $HOME/.bashrc; then echo "export PATH=\$HOME/chectl/bin:\$PATH" >> $HOME/.bashrc; fi
|
|
- id: install-goimports
|
|
exec:
|
|
label: POST START EVENT - Install goimports
|
|
component: tooling-container
|
|
commandLine: |
|
|
$HOME/go1.18/bin/go install golang.org/x/tools/cmd/goimports@latest && \
|
|
if ! grep -q "PATH=\$PATH:\$GOPATH/bin" $HOME/.bashrc; then echo "export PATH=\$PATH:\$GOPATH/bin" >> $HOME/.bashrc; fi
|
|
- id: install-git-autocompletion
|
|
exec:
|
|
label: POST START EVENT - Install git autocompletion
|
|
component: tooling-container
|
|
commandLine: if ! grep -q "source /usr/share/bash-completion/completions/git" $HOME/.bashrc; then echo "source /usr/share/bash-completion/completions/git" >> $HOME/.bashrc; fi
|
|
- id: install-oc-autocompletion
|
|
exec:
|
|
label: POST START EVENT - Install oc autocompletion
|
|
component: tooling-container
|
|
commandLine: |
|
|
oc completion bash > $HOME/oc_bash_completion && \
|
|
if ! grep -q "source \$HOME/oc_bash_completion" $HOME/.bashrc; then echo "source \$HOME/oc_bash_completion" >> $HOME/.bashrc; fi
|
|
- id: go-build
|
|
exec:
|
|
label: Build Eclipse Che Operator binary
|
|
component: tooling-container
|
|
commandLine: make build
|
|
- id: go-run
|
|
exec:
|
|
label: Run Eclipse Che Operator
|
|
component: tooling-container
|
|
commandLine: make run
|
|
- id: go-test
|
|
exec:
|
|
label: Run unit tests
|
|
component: tooling-container
|
|
commandLine: make test
|
|
- id: go-debug
|
|
exec:
|
|
label: Run and debug Eclipse Che Operator
|
|
component: tooling-container
|
|
commandLine: make debug
|
|
- id: update-dev-resources
|
|
exec:
|
|
label: Update all development resources
|
|
component: tooling-container
|
|
commandLine: make update-dev-resources
|
|
events:
|
|
postStart:
|
|
- install-go-1-18
|
|
- install-chectl
|
|
- install-goimports
|
|
- install-git-autocompletion
|
|
- install-oc-autocompletion
|
|
|
|
|