-
Notifications
You must be signed in to change notification settings - Fork 8
CodeReady Workspaces
From now on lets call CodeReady Workspaces CRW.
You can create a workspace with one click
Each use can have multiple workspaces but only one running.
If it is the first time you create a workspace, additional steps are necessary.
Because we use self-signed certificates you need to trust them.
Please follow the instructions provided here.
The first time you will get an error that the repository for hogarama cannot be cloned.
That's because the location in the devfile is defined as [email protected]:Gepardec/Hogarama.git
.
Press F1 and type SSH: generate key pair
view the public key and add it your github account.
Restart the workspace: Open the navigation bar (top left corner) -> Workspaces -> click on the workspace -> Stop button (top right corner) -> Open button -> wait.
Now the repository should be cloned.
The java language support is not active by default. It activates when you open a java file.
At the bottom you should see it gets activated.
This has to be done after every start of the workspace.
Java autobuild is interfering with the maven build. To disable it open the preferences (shortcut ctrl+,
) and search for java.
You can trigger a build with the shortcut shift + alt + b
(the language support for java must be activated for the shortcut to work).
Now you should be able to contribute code and see the following view.
On the right side in the view My Workspace
predefined commands are available
Builds the Hogajama project
Install or uninstall the components with helm into the same openshift project.
Important: They keep running after the workspace stops.
Configures a JBoss with the scripts located in Hogarama/Hogajama/configuration/local_configuration
and environment variables from Hogarama/codereadyworkspace/hogarama_dev.env
This command keeps running and shows the jboss logs.
Deploys all war files with jbss deploy
.
If you change something in Hogarama/codereadyworkspace/hogarama_dev.env
or continue working use this command to start or restart the JBoss.
Like Configure Hogajama JBoss
this command keeps running and shows the JBoss logs.
Opens the application in your browser.
Opens a terminal and connects with psql to the postgres host/user/password defined in Hogarama/codereadyworkspace/hogarama_dev.env
For example show the tables with \d
You can execute tests from within the test class (1) or use the plugin view on the left side.
Display a test report page by opening it over the bottom toolbar (2).
CRW is installed using an operator. We followed the official documentation from Red Hat.
For further configuration we used Chapter 5. Advanced configuration options for the CodeReady Workspaces component.
You can find the current configuration from our CRW instance in our Hogarama Git Repository.
Because of the operator it is very easy to modify the CRW instance.
Below find the parameters which we edited and why they were edited.
CRW starts your workspace in a single pod with several containers in it. The default serviceaccount associated with the pod is che-workspace.
Because we have a container where we use helm to install some components, the serviceaccount che-workspace needs the permissions to do that.
With that parameter you can add roles to the serviceaccount. In our case the available clusterrole edit
.
The containers in the workspace pod have imagePullPolicy defined as always, which is the default.
Because it is not necessary to always download the images, when a workspace is starting, we defined IfNotPresent
.
There was no way to execute java unit tests directly within the IDE.
The VS Code Extension vscode-java-test adds that functionality but is missing in CRW 2.3.
We simply extended the plugin registry image, pushed it docker hub and reference it with the parameter pluginRegistryImage
.
Dockerfile
FROM registry.redhat.io/codeready-workspaces/pluginregistry-rhel8@sha256:e2f865550b46ead535c4b6cd8204889957e3bbc73300ad8af4e4e6a570249477
ADD https://github.com/microsoft/vscode-java-test/releases/download/0.22.3/vscjava.vscode-java-test-0.22.3.vsix /var/www/html/v3/resources/chepardec/
ADD meta.yaml /var/www/html/v3/plugins/redhat/java8/latest/meta.yaml
meta.yaml
apiVersion: v2
publisher: redhat
name: java8
version: latest
type: VS Code extension
displayName: Language Support for Java 8
title: Language Support for Java(TM) by Red Hat
description: Java Linting, Intellisense, formatting, refactoring, Maven/Gradle support
and more...
icon: https://raw.githubusercontent.com/redhat-developer/codeready-workspaces/master/dependencies/che-plugin-registry/resources/images/default.svg?sanitize=true
repository: https://github.com/redhat-developer/vscode-java
category: Language
firstPublicationDate: '2020-07-22'
spec:
containers:
- image: "registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:b6e36406e7f8ff86f462f370f55143446ceb0c555b86b13593436f5e71b7cab1" # tag: registry.redhat.io/codeready-workspaces/plugin-java8-rhel8:2.3
name: vscode-java
memoryLimit: 1500Mi
args:
- sh
- -c
- ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}
volumes:
- mountPath: /home/theia/.m2
name: m2
extensions:
- relative:extension/resources/download.jboss.org/jbosstools/vscode/3rdparty/vscode-java-debug/vscode-java-debug-0.26.0.vsix
- relative:extension/resources/download.jboss.org/jbosstools/static/jdt.ls/stable/java-0.63.0-2222.vsix
- relative:extension/resources/chepardec/vscjava.vscode-java-test-0.22.3.vsix
latestUpdateDate: "2020-08-12"
If you want to run your workspace in an existing openshift project you need to set this parameter to true
If you do not define a namespace, the format of the new openshift project name is chepardec-<workspaceid>
.
- Home
- Setup Guide
- Using Hogarama
-
Cloud Components
- AMQ
- MongoDB
- Single Sign On
- Hogajama
- Kafka
- Habarama
- Troubleshooting Hogarama
- Optional Modules
- Developer Guideline