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

chore: Export git repositories as zip files for Devfile v2 #532

Merged
merged 3 commits into from
Dec 8, 2021

Conversation

vinokurig
Copy link
Contributor

Signed-off-by: Igor Vinokur ivinokur@redhat.com

What does this PR do?

  • Clone and zip every git repository which is mentioned in the v2 link
  • Update the devfile v2 template with the link to the project zip

Screenshot/screencast of this PR

What issues does this PR fix or reference?

eclipse-che/che#20720

How to test this PR?

  1. Run ./build.sh to build an image.
  2. Run the image: docker run -it --rm -p 8080:8080 quay.io/eclipse/che-devfile-registry:next.
  3. Check that /resources/v2 folder is present and contains zip projects.
  4. Check any devworkspace-che-theia-next.yaml or devworkspace-che-theia-latest.yaml to contain a project section with the zip in its location.

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.

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

Click here to review and test in web IDE: Contribute

1 similar comment
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

Click here to review and test in web IDE: Contribute

@vinokurig
Copy link
Contributor Author

depends on eclipse-che/che#20877

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Click here to review and test in web IDE: Contribute

1 similar comment
@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

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.

LGTM! Just one comment, see above.

Generated DevWorkspace for cpp

apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspaceTemplate
metadata:
  name: theia-ide-cpp
spec:
  commands:
    - id: init-container-command
      apply:
        component: remote-runtime-injector
  events:
    preStart:
      - init-container-command
  components:
    - name: theia-ide
      container:
        image: >-
          quay.io/eclipse/che-theia@sha256:73588f8d6b5078726e90b48e06f10594758c93532339dc1ec48192e7faa2fc71
        env:
          - name: THEIA_PLUGINS
            value: local-dir:///plugins
          - name: HOSTED_PLUGIN_HOSTNAME
            value: 0.0.0.0
          - name: HOSTED_PLUGIN_PORT
            value: '3130'
          - name: THEIA_HOST
            value: 127.0.0.1
        volumeMounts:
          - name: plugins
            path: /plugins
          - name: theia-local
            path: /home/theia/.theia
        mountSources: true
        memoryLimit: 512M
        cpuLimit: 1500m
        cpuRequest: 100m
        endpoints:
          - name: theia
            attributes:
              type: main
              cookiesAuthEnabled: true
              discoverable: false
              urlRewriteSupported: true
            targetPort: 3100
            exposure: public
            secure: false
            protocol: https
          - name: webviews
            attributes:
              type: webview
              cookiesAuthEnabled: true
              discoverable: false
              unique: true
              urlRewriteSupported: true
            targetPort: 3100
            exposure: public
            secure: false
            protocol: https
          - name: mini-browser
            attributes:
              type: mini-browser
              cookiesAuthEnabled: true
              discoverable: false
              unique: true
              urlRewriteSupported: true
            targetPort: 3100
            exposure: public
            secure: false
            protocol: https
          - name: theia-dev
            attributes:
              type: ide-dev
              discoverable: false
              urlRewriteSupported: true
            targetPort: 3130
            exposure: public
            protocol: http
          - name: theia-redirect-1
            attributes:
              discoverable: false
              urlRewriteSupported: true
            targetPort: 13131
            exposure: public
            protocol: http
          - name: theia-redirect-2
            attributes:
              discoverable: false
              urlRewriteSupported: true
            targetPort: 13132
            exposure: public
            protocol: http
          - name: theia-redirect-3
            attributes:
              discoverable: false
              urlRewriteSupported: true
            targetPort: 13133
            exposure: public
            protocol: http
          - name: terminal
            attributes:
              type: collocated-terminal
              discoverable: false
              cookiesAuthEnabled: true
              urlRewriteSupported: true
            targetPort: 3333
            exposure: public
            secure: false
            protocol: wss
      attributes:
        app.kubernetes.io/component: che-theia
        app.kubernetes.io/part-of: che-theia.eclipse.org
    - name: plugins
      volume: {}
    - name: theia-local
      volume: {}
    - name: che-machine-exec
      container:
        image: >-
          quay.io/eclipse/che-machine-exec@sha256:2e244dd5b3ed0baf00570a21a904b4066a35b1618a0a0fb0aa02e345c4faeeeb
        command:
          - /go/bin/che-machine-exec
          - '--url'
          - 127.0.0.1:3333
      attributes:
        app.kubernetes.io/component: machine-exec
        app.kubernetes.io/part-of: che-theia.eclipse.org
    - name: remote-runtime-injector
      container:
        image: >-
          quay.io/eclipse/che-theia-endpoint-runtime-binary@sha256:d4327b40cb3aae5d59f618c0fe5903683ea4fe5a412f4d421f787c77eaf94315
        env:
          - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
            value: /remote-endpoint/plugin-remote-endpoint
         - name: REMOTE_ENDPOINT_VOLUME_NAME
            value: remote-endpoint
        volumeMounts:
          - name: plugins
            path: /plugins
          - name: remote-endpoint
            path: /remote-endpoint
      attributes:
        app.kubernetes.io/component: remote-runtime-injector
        app.kubernetes.io/part-of: che-theia.eclipse.org
    - name: remote-endpoint
      volume:
        ephemeral: true
  projects:
    - name: cpp-hello-world
      zip:
        location: '{{ DEVFILE_REGISTRY_URL }}/resources/v2/cpp-hello-world.zip'
---
apiVersion: workspace.devfile.io/v1alpha2
kind: DevWorkspace
metadata:
  name: cpp
spec:
  started: true
  template:
    attributes:
      che-theia.eclipse.org/sidecar-policy: USE_DEV_CONTAINER
    components:
      - name: cpp-dev
        container:
          image: quay.io/devfile/universal-developer-image:ubi8-1e8c2c9
          memoryLimit: 1G
          mountSources: true
          env:
            - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
              value: /remote-endpoint/plugin-remote-endpoint
            - name: THEIA_PLUGINS
              value: local-dir:///plugins/sidecars/cpp-dev
          volumeMounts:
            - path: /remote-endpoint
              name: remote-endpoint
            - path: /plugins
              name: plugins
          args:
            - sh
            - '-c'
            - ${PLUGIN_REMOTE_ENDPOINT_EXECUTABLE}
        attributes:
          che-theia.eclipse.org/vscode-extensions:
            - >-
              https://download.jboss.org/jbosstools/vscode/3rdparty/cdt-vscode/cdt-vscode-0.0.7-75cf95.vsix
            - >-
              https://download.jboss.org/jbosstools/vscode/3rdparty/cdt-gdb-vscode/cdt-gdb-vscode-0.0.91-2cbbb8.vsix
            - >-
              https://download.jboss.org/jbosstools/vscode/3rdparty/vscode-clangd/vscode-clangd-0.1.5-562d00.vsix
          app.kubernetes.io/name: cpp-dev
      - name: theia-ide-cpp
        plugin:
          kubernetes:
            name: theia-ide-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

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Click here to review and test in web IDE: Contribute

@vinokurig vinokurig merged commit 832b5b8 into main Dec 8, 2021
@vinokurig vinokurig deleted the che-20720 branch December 8, 2021 13:47
@che-bot che-bot added this to the 7.41 milestone Dec 8, 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