5.8. Theia ベースの IDE

本セクションでは、Eclipse Theia フレームワークに基づいてカスタム IDE を提供する方法を説明します。

Red Hat CodeReady Workspaces で Theia ベースの IDE をエディターとして使用するには、2 つの主要コンポーネントを準備する必要があります。

  • IDE を含む Docker イメージ
  • Che エディター記述子ファイル - meta.yaml

手順

  1. エディター記述子 - meta.yaml ファイルで IDE を記述します。

    version: 1.0.0
    editors:
      - id: eclipse/che-theia/next
        title: Eclipse Theia development version.
        displayName: theia-ide
        description: Eclipse Theia, get the latest release each day.
        icon: https://raw.githubusercontent.com/theia-ide/theia/master/logo/theia-logo-no-text-black.svg?sanitize=true
        repository: https://github.com/eclipse-che/che-theia
        firstPublicationDate: "2021-01-01"
        endpoints:
          - name: "theia"
            public: true
            targetPort: 3100
            attributes:
              protocol: http
              type: ide
              secure: true
              cookiesAuthEnabled: true
              discoverable: false
        containers:
          - name: theia-ide
            image: "<your-ide-image>"
            mountSources: true
            ports:
              - exposedPort: 3100
            memoryLimit: "512M"

    targetPort および exposedPort は、コンテナー内で実行している Theia ベースの IDE と同じでなければなりません。<your-ide-image> を IDE イメージの名前に置き換えます。meta.yaml ファイルは、HTTP(S)リンクを介して一般にアクセスできる必要があります。

  2. エディターを Devfile に追加します。

    apiVersion: 1.0.0
    metadata:
      name: che-theia-based-ide
    components:
      - type: cheEditor
        reference: '<meta.yaml URL>'

    <meta.yaml URL> は、直前の手順で説明されている公開されている meta.yaml ファイルを参照している必要があります。