Skip to content

Commit

Permalink
Add docs how to build Che server in Che workspace
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Morhun <[email protected]>
  • Loading branch information
mmorhun committed Aug 13, 2019
1 parent e1c2b87 commit 9ffbd91
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 58 deletions.
46 changes: 0 additions & 46 deletions .che-dev.yaml

This file was deleted.

19 changes: 18 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,21 @@ $ node_modules/.bin/gulp serve --server=<che_api_url>


### Che server a.k.a WS master
To be provided soon.
There is a [devfile](https://github.com/eclipse/che/blob/master/devfile.yaml) for development of Che server in Che.
To build Che one may run a predefined build task from the devfile.

Starting Che master requires some manual steps:
- First, set `CHE_HOME` environment variable with absolute path to parent folder of Che master's Tomcat.
It might look like `/projects/che/assembly/assembly-main/target/eclipse-che-*-SNAPSHOT/eclipse-che-*-SNAPSHOT`.
- Then set `CHE_HOST` with the endpoint of new Che master. For the devfile it should be `che-dev`
For example, for Minishift it might be `http://che-che.192.168.99.102.nip.io`.
- Then set `CHE_INFRASTRUCTURE_ACTIVE` according to your environment.
For example: `openshift` (note, use `kubernetes` and `openshift` insted of `minikube` and `minishift` correspondingly).
- Run `/entrypoint.sh`.
After this, new Che master should be accesible from the `che-dev` endpoint.
To reach Swagger use url from `che-dev` endpoint with `/swagger` suffix.

To start a workspace from Che server under development some additional configuration of the cluster is needed.
One should add rights for the service account to be able to perform all needed for Che server actions.
Also `CHE_API_INTERNAL`, `CHE_API_EXTERNAL` and `CHE_API` should be set in runner container and point to new Che server API.
Example value for `CHE_API*` variables: `http://che-dev:8080/api`.
41 changes: 35 additions & 6 deletions devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
apiVersion: 1.0.0
metadata:
name: che-in-che
name: che-server-in-che
projects:
- name: che
source:
type: git
location: 'https://github.com/eclipse/che.git'
components:
- alias: che-dev
type: kubernetes
reference: .che-dev.yaml
- type: dockerimage
image: 'eclipse/che-dev:nightly'
alias: che-server-dev
mountSources: true
memoryLimit: 5Gi
volumes:
- name: maven
containerPath: /home/user/.m2
- type: dockerimage
image: 'eclipse/che-server:nightly'
alias: che-server-runtime
mountSources: true
memoryLimit: 2Gi
endpoints:
- name: che-dev
attributes:
discoverable: 'true'
public: 'true'
port: 8080
command:
- 'tail'
args:
- '-f'
- '/dev/null'
- type: chePlugin
id: redhat/java8/latest
commands:
- name: fastbuild
- name: build
actions:
- type: exec
component: che-dev
component: che-server-dev
command: cd /projects/che && mvn clean install -Pnative -DskipIntegrationTests
workdir: /projects/che
- name: build without tests
actions:
- type: exec
component: che-server-dev
command: cd /projects/che && mvn clean install -Pnative -DskipTests=true
workdir: /projects/che
15 changes: 10 additions & 5 deletions dockerfiles/che/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,17 @@ init() {
### Any variables with export is a value that native Tomcat che.sh startup script requires
export CHE_IP=${CHE_IP}

if [ -f "/assembly/tomcat/bin/catalina.sh" ]; then
echo "Found custom assembly..."
export CHE_HOME="/assembly"
if [ -z "$CHE_HOME" ]; then
if [ -f "/assembly/tomcat/bin/catalina.sh" ]; then
echo "Found custom assembly in /assembly"
export CHE_HOME="/assembly"
else
echo "Using embedded assembly."
export CHE_HOME=$(echo /home/user/eclipse-che/)
fi
else
echo "Using embedded assembly..."
export CHE_HOME=$(echo /home/user/eclipse-che/)
echo "Using custom assembly from $CHE_HOME"
export CHE_HOME=${CHE_HOME}
fi

### We need to discover the host mount provided by the user for `/data`
Expand Down

0 comments on commit 9ffbd91

Please sign in to comment.