Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

feat: introduce che-code prebuilt templates #553

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

benoitf
Copy link
Contributor

@benoitf benoitf commented Dec 15, 2021

What does this PR do?

Add prebuilt templates for che-code

Screenshot/screencast of this PR

What issues does this PR fix or reference?

eclipse-che/che#19906

How to test this PR?

Build and run devfile-registry

check http://localhost:8080/devfiles/ (and see new devWorkspaces links)
Also check http://localhost:8080/devfiles/quarkus/devworkspace-che-code-insiders.yaml

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Change-Id: I200f609b1890c39dd63a335b00f160ae1b49fb9c
Signed-off-by: Florent Benoit fbenoit@redhat.com

Change-Id: I200f609b1890c39dd63a335b00f160ae1b49fb9c
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
@github-actions
Copy link

Click here to review and test in web IDE: Contribute

Copy link
Contributor

@svor svor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bash-5.0# cd cpp/
bash-5.0# ls
devfile.yaml  devworkspace-che-code-insiders.yaml  devworkspace-che-theia-latest.yaml  devworkspace-che-theia-next.yaml  meta.yaml
bash-5.0# cat devworkspace-che-code-insiders.yaml 
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspaceTemplate
metadata:
  name: che-code-cpp
spec:
  commands:
    - id: init-container-command
      apply:
        component: che-code-injector
  events:
    preStart:
      - init-container-command
  components:
    - name: checode
      volume: {}
    - name: che-code-injector
      container:
        image: quay.io/che-incubator/che-code:insiders
        command:
          - /entrypoint-init-container.sh
        volumeMounts:
          - name: checode
            path: /checode
        memoryLimit: 128Mi
        memoryRequest: 32Mi
        cpuLimit: 500m
        cpuRequest: 30m
---
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
  name: cpp
spec:
  started: true
  template:
    components:
      - name: cpp-dev
        container:
          image: quay.io/devfile/universal-developer-image:ubi8-1e8c2c9
          memoryLimit: 2.07G
          mountSources: true
          command:
            - /checode/entrypoint-volume.sh
          volumeMounts:
            - name: checode
              path: /checode
          endpoints:
            - name: che-code
              attributes:
                type: main
                cookiesAuthEnabled: true
                discoverable: false
                urlRewriteSupported: true
                contributed-by: che-code.eclipse.org
              targetPort: 3100
              exposure: public
              path: '?tkn=eclipse-che'
              secure: false
              protocol: https
          memoryRequest: 256Mi
          cpuLimit: 500m
          cpuRequest: 30m
        attributes:
          che-code.eclipse.org/contribute-entry-point: true
          che-code.eclipse.org/contribute-volume-mount/checode: /checode
          che-code.eclipse.org/contribute-endpoint/che-code: 3100
          che-code.eclipse.org/contribute-memoryLimit: true
          che-code.eclipse.org/original-memoryLimit: 1G
          che-code.eclipse.org/contribute-memoryRequest: true
          che-code.eclipse.org/contribute-cpuLimit: true
          che-code.eclipse.org/contribute-cpuRequest: true
          che-code.eclipse.org/contributed-container: cpp-dev
      - name: che-code-cpp
        plugin:
          kubernetes:
            name: che-code-cpp
    commands:
      - id: build
        exec:
          label: Build application
          component: cpp-dev
          workingDir: ${PROJECTS_ROOT}/cpp-hello-world
          commandLine: g++ -g hello.cpp -o hello.out && echo "Build complete"
          group:
            kind: build
            isDefault: true
      - id: run
        exec:
          label: Run application
          component: cpp-dev
          workingDir: ${PROJECTS_ROOT}/cpp-hello-world
          commandLine: ./hello.out
          group:
            kind: run
    projects:
      - name: cpp-hello-world
        zip:
          location: '{{ INTERNAL_URL }}/resources/v2/cpp-hello-world.zip'

@benoitf benoitf merged commit afd8700 into eclipse-che:main Dec 15, 2021
@che-bot che-bot added this to the 7.41 milestone Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants