|
| 1 | +:_content-type: PROCEDURE |
| 2 | + |
| 3 | +[id="adding-or-removing-extensions-in-a-workspace_{context}"] |
| 4 | += Adding or removing extensions by using a {prod-short} workspace |
| 5 | + |
| 6 | +You can add or remove extensions in the embedded Open VSX registry instance directly within a {prod-short} workspace. This results in a custom build of the Open VSX registry that can be used in your organization's workspaces. |
| 7 | + |
| 8 | +[IMPORTANT] |
| 9 | +==== |
| 10 | +You can manage Visual Studio Code extensions by setting up and using an internal, on-premises Open VSX registry. This approach provides full control over the extension lifecycle, enables offline use, and improves compliance. The embedded plugin registry will be deprecated in future releases, with the Open VSX registry serving as its successor. Refer to the xref:running-the-open-vsx-on-premises.adoc[Running the Open VSX On-Premises] procedure for detailed setup instructions. |
| 11 | +==== |
| 12 | + |
| 13 | +.Prerequisites |
| 14 | + |
| 15 | +* You are logged in to your {prod-short} instance as an administrator. |
| 16 | +* You have started a workspace using the link:https://github.com/eclipse-che/che-plugin-registry[plugin registry repository]. |
| 17 | +* You have created a link:https://access.redhat.com/terms-based-registry/[Red Hat Registry Service Account] and have the username and token available. |
| 18 | +* For IBM Power (`ppc64le`) and IBM Z (`s390x`) architectures, you must build the custom plugin registry locally on the corresponding hardware. |
| 19 | +* (Optional) You can rebuild the container based on the latest tag or SHA to get the latest security fixes after a {prod-short} update. |
| 20 | + |
| 21 | +.Procedure |
| 22 | + |
| 23 | +. Open a terminal in your workspace. |
| 24 | + |
| 25 | +. Check out the Git tag that corresponds to your {prod-short} version: |
| 26 | ++ |
| 27 | +[source,bash,subs="+quotes"] |
| 28 | +---- |
| 29 | +$ git checkout __<product_version>__ |
| 30 | +---- |
| 31 | + |
| 32 | +. Identify the publisher and extension name for each extension you want to add: |
| 33 | +.. Find the extension on the link:https://open-vsx.org/[Open VSX registry website]. |
| 34 | +.. Copy the URL of the extension's listing page. |
| 35 | +.. Extract the `<publisher>` and `<name>` from the URL: |
| 36 | ++ |
| 37 | +[subs="+quotes"] |
| 38 | +---- |
| 39 | +https://open-vsx.org/extension/__<publisher>__/__<name>__ |
| 40 | +---- |
| 41 | ++ |
| 42 | +[TIP] |
| 43 | +==== |
| 44 | +If the extension is only available from link:https://marketplace.visualstudio.com/VSCode[Microsoft Visual Studio Marketplace], but not link:https://open-vsx.org[Open VSX], you can ask the extension publisher to publish it on link:https://open-vsx.org[open-vsx.org] according to these link:https://github.com/eclipse/openvsx/wiki/Publishing-Extensions#how-to-publish-an-extension[instructions], potentially using this link:https://github.com/marketplace/actions/publish-vs-code-extension[GitHub action]. |
| 45 | +
|
| 46 | +If the extension publisher is unavailable or unwilling to publish the extension to link:https://open-vsx.org[open-vsx.org], and if there is no Open VSX equivalent of the extension, consider link:https://github.com/open-vsx/publish-extensions/issues[reporting an issue] to the Open VSX team. |
| 47 | +==== |
| 48 | + |
| 49 | +. Open the `openvsx-sync.json` file in the repository. |
| 50 | + |
| 51 | +. Add or remove extensions using the following JSON syntax: |
| 52 | ++ |
| 53 | +[source,json,subs="+quotes"] |
| 54 | +---- |
| 55 | +{ |
| 56 | + "id": "__<publisher>__.__<name>__", |
| 57 | + "version": "__<extension_version>__" |
| 58 | +} |
| 59 | +---- |
| 60 | ++ |
| 61 | +[TIP] |
| 62 | +==== |
| 63 | +If you have a closed-source extension or an extension developed only for internal use in your organization, you can add the extension directly from a `.vsix` file by using a URL accessible to your custom plugin registry container: |
| 64 | +
|
| 65 | +[source,json,subs="+quotes"] |
| 66 | +---- |
| 67 | +{ |
| 68 | + "id": "__<publisher>__.__<name>__", |
| 69 | + "download": "__<url_to_download_vsix_file>__", |
| 70 | + "version": "__<extension_version>__" |
| 71 | +} |
| 72 | +---- |
| 73 | +
|
| 74 | +Read the link:https://aka.ms/vsmarketplace-ToU[Terms of Use] for the link:https://marketplace.visualstudio.com/VSCode[Microsoft Visual Studio Marketplace] before using its resources. |
| 75 | +==== |
| 76 | + |
| 77 | +. Log in to the Red Hat registry: |
| 78 | +.. Navigate to *Terminal* -> *Run Task...* -> *devfile*. |
| 79 | +.. Run the *1. Login to registry.redhat.io* task. |
| 80 | +.. Enter your Red Hat Registry Service Account credentials when prompted. |
| 81 | + |
| 82 | +. Build and publish the custom plugin registry: |
| 83 | +.. Navigate to *Terminal* -> *Run Task...* -> *devfile*. |
| 84 | +.. Run the *2. Build and Publish a Custom Plugin Registry* task. |
| 85 | ++ |
| 86 | +[NOTE] |
| 87 | +==== |
| 88 | +Verify that the `CHE_CODE_VERSION` in the `build-config.json` file matches the version of the editor currently used with {prod-short}. Update it if necessary. |
| 89 | +==== |
| 90 | + |
| 91 | +. Configure {prod-short} to use the custom plugin registry: |
| 92 | +.. Navigate to *Terminal* -> *Run Task...* -> *devfile*. |
| 93 | +.. Run the *3. Configure Che to use the Custom Plugin Registry* task. |
| 94 | + |
| 95 | +.Verification |
| 96 | + |
| 97 | +. Check that the `plugin-registry` pod has restarted and is running. |
| 98 | +. Restart your workspace. |
| 99 | +. Open the *Extensions* view in the IDE and verify that your added extensions are available. |
| 100 | + |
| 101 | +.Additional resources |
| 102 | + |
| 103 | +* link:https://github.com/eclipse-che/che-plugin-registry[Plugin registry repository] |
| 104 | +* xref:running-the-open-vsx-on-premises.adoc[Running the Open VSX On-Premises] |
0 commit comments