You can do che-plugin-broker development inside Eclipse Che workspace.
To install Eclipse Che you need to choose infrastructure(openshift, kubernetes) and set it up. To create development Eclipse Che workspace we provide che-plugin-broker devfile devfile.yaml.
See more about devfile
To start Eclipse Che workspace, install the latest chectl and start new workspace from devfile:
$ chectl workspace:start --devfile=https://raw.githubusercontent.com/eclipse/che-plugin-broker/master/devfile.yaml
Then, open the link to the workspace. After the workspace starts, the Eclipse Che editor
clones che-plugin-broker source code to the folder /projects/src/github.com/eclipse/che-plugin-broker
.
There are two development linux containers inside workspace: dev
and plugin-registry
.
dev
container created for development che-plugin-broker. It contains pre-installed development binaries:
golang, git, golangci-lint and so on. In the devfile, /plugins
is mounted as a volume on the dev
container
to store plugins binaries downloaded with help of unified
plugin broker.
plugin-registry
container is a micro-service to serve Eclipse Che plugins meta.yaml definitions.
The devfile defines this container in the workspace, and the plugin-registry's service is exposed in the internal container's network.
The unified
plugin broker can connect to this service to get plugins meta.yaml information.
devfile.yaml provides development tasks
for the Eclipse Che workspace.
These are defined in the devfile commands
section.
To launch development commands in the Eclipse Che workspace, you can:
-
My Workspace
panel. In this panel you can find development tasks and launch them by click. -
Run task...
menu: clickTerminal
menu in the main toolbar => clickRun task...
menu => select task by name and click it.
Notice: also you can find menu
Run task...
using command palette. Type shortcutCtrl/Cmd + Shift + P
to call command palette, typerun task
.
- Manually type task content in the terminal:
Terminal
=>Open Terminal in specific container
=> select container with namedev
and click Enter.
Notice: use correct working dir for commands in the terminal.
There are two plugin brokers, that's why we have two commands to compile each of them.
To compile init
plugin broker use task with name compile "init" plugin broker
. Compiled binary will be located in the init-plugin-broker binary folder.
To compile unified
plugin broker use task with name compile "unified" plugin broker
. Compiled binary will be located in the unified-plugin-broker binary folder.
To start init
plugin broker use command start "init" plugin broker
. After execution this task volume /plugins
in the dev
container should be clean
(you can check it with help of terminal).
To start unified
plugin broker use task start "unified" plugin broker
. After execution this task volume /plugins
should contains downloaded plugin binaries in the subfolder sidecars
(you can check it with help of terminal).
To launch che-plugin-broker tests use task with name run tests
.
During development don't forget to format code.
To format che-plugin-broker code use task with name format code
.
To lint che-plugin-broker code use task lint code
.