This section explains how to modify the existing content of the devfile and plug-in registries: the devfiles and plug-in metadata.
Adding a plug-in at runtime
To add a plug-in:
-
Check out the plugin registry sources.
$ git clone https://github.com/eclipse/che-plugin-registry; \ cd che-plugin-registry
-
Create a
meta.yamlin some local folder. This can be done from scratch or by copying from an existing plug-in’smeta.yamlfile.$ PLUGIN="v3/plugins/new-org/new-plugin/0.0.1"; \ mkdir -p ${PLUGIN}; cp v3/plugins/che-incubator/cpptools/0.1/* ${PLUGIN}/ echo "${PLUGIN##*/}" > ${PLUGIN}/../latest.txt -
If copying from an existing plug-in, make changes to the
meta.yamlfile to suit your needs. Make sure your new plug-in has a uniquetitle,displayNameanddescription. Update thefirstPublicationDateto today’s date. -
These fields in
meta.yamlmust match the path defined inPLUGINabove.publisher: new-org name: new-plugin version: 0.0.1
-
Get the name of the Pod that hosts the plug-in registry container. To do this, filter the
component=plugin-registrylabel:$ PLUGIN_REG_POD=$(kubectl get -o custom-columns=NAME:.metadata.name \ --no-headers pod -l component=plugin-registry)
-
Regenerate the registry’s
index.jsonfile to include your new plug-in.$ cd che-plugin-registry; \ "$(pwd)/build/scripts/generate_latest_metas.sh" v3 && \ "$(pwd)/build/scripts/check_plugins_location.sh" v3 && \ "$(pwd)/build/scripts/set_plugin_dates.sh" v3 && \ "$(pwd)/build/scripts/check_plugins_viewer_mandatory_fields.sh" v3 && \ "$(pwd)/build/scripts/index.sh" v3 > v3/plugins/index.json -
Copy the new
index.jsonandmeta.yamlfiles from your new local plug-in folder to the container.$ cd che-plugin-registry; \ LOCAL_FILES="$(pwd)/${PLUGIN}/meta.yaml $(pwd)/v3/plugins/index.json"; \ kubectl exec ${PLUGIN_REG_POD} -i -t -- mkdir -p /var/www/html/${PLUGIN}; \ for f in $LOCAL_FILES; do e=${f/$(pwd)\//}; echo "Upload ${f} -> /var/www/html/${e}"; \ kubectl cp "${f}" ${PLUGIN_REG_POD}:/var/www/html/${e}; done -
The new plug-in can now be used from the existing Che instance’s plug-in registry. To discover it, go to the Che dashboard, then click the
Workspaceslink. From there, click the gear icon to configure one of your workspaces. Select thePluginstab to see the updated list of available plug-ins.
Adding a devfile at runtime
To add a devfile:
-
Check out the devfile registry sources.
$ git clone https://github.com/eclipse/che-devfile-registry; \ cd che-devfile-registry
-
Create a
devfile.yamlandmeta.yamlin some local folder. This can be done from scratch or by copying from an existing devfile.$ STACK="new-stack"; \ mkdir -p devfiles/${STACK}; cp devfiles/nodejs/* devfiles/${STACK}/ -
If copying from an existing devfile, make changes to the devfile to suit your needs. Make sure your new devfile has a unique
displayNameanddescription. -
Get the name of the Pod that hosts the devfile registry container. To do this, filter the
component=devfile-registrylabel:$ DEVFILE_REG_POD=$(kubectl get -o custom-columns=NAME:.metadata.name \ --no-headers pod -l component=devfile-registry)
-
Regenerate the registry’s
index.jsonfile to include your new devfile.$ cd che-devfile-registry; \ "$(pwd)/build/scripts/check_mandatory_fields.sh" devfiles; \ "$(pwd)/build/scripts/index.sh" > index.json
-
Copy the new
index.json,devfile.yamlandmeta.yamlfiles from your new local devfile folder to the container.$ cd che-devfile-registry; \ LOCAL_FILES="$(pwd)/${STACK}/meta.yaml $(pwd)/${STACK}/devfile.yaml $(pwd)/index.json"; \ kubectl exec ${DEVFILE_REG_POD} -i -t -- mkdir -p /var/www/html/devfiles/${STACK}; \ for f in $LOCAL_FILES; do e=${f/$(pwd)\//}; echo "Upload ${f} -> /var/www/html/devfiles/${e}" kubectl cp "${f}" ${DEVFILE_REG_POD}:/var/www/html/devfiles/${e}; done -
The new devfile can now be used from the existing Che instance’s devfile registry. To discover it, go to the Che dashboard, then click the
Workspaceslink. From there, clickAdd Workspaceto see the updated list of available devfiles.