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

chore: don't generate theia resources; remove sidecars; add devfile.yaml to work with the registry #726

Merged
merged 10 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions .ci/devfile-images-check.sh

This file was deleted.

44 changes: 0 additions & 44 deletions .devfile-v2.yaml

This file was deleted.

62 changes: 0 additions & 62 deletions .github/workflows/build-sidecar-images-on-push.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/check-sidecar-image-digests.yml

This file was deleted.

27 changes: 1 addition & 26 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020-2021 Red Hat, Inc.
# Copyright (c) 2020-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -26,31 +26,6 @@ jobs:
find . -type f -name '*.sh' | wc -l
find . -type f -name '*.sh' | xargs shellcheck --external-sources

digest-validation:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Run script which checks container image digest
run: |
sudo pip install yq
/bin/bash .ci/devfile-images-check.sh

build-sidecar-images:
runs-on: ubuntu-22.04
steps:
- name: Clone source code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Rebuild sidecar images
run: ./build/workflows/build-sidecar-images-on-push.sh --rm
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}

build-main-image:
runs-on: ubuntu-22.04
steps:
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
# Eclipse Che devfile registry

This repository holds ready-to-use Devfiles for different languages and technologies.
This repository holds meta.yaml files that refer to the samples with Devfiles.

Here is an example `meta.yaml` file:

```yaml
---
displayName: Python
description: Python Stack with Python 3.8
tags: ["Community", "Centos", "Python", "pip"]
icon: /images/python.svg
links:
v2: https://github.com/che-samples/python-hello-world/tree/main
```

Here are all the supported values:
svor marked this conversation as resolved.
Show resolved Hide resolved
```yaml
---
# the name of the stack
displayName: Python
# the description of the stack
description: Python Stack with Python 3.8
# the list of tags that will be used to search for the devfile
tags: ["Community", "Centos", "Python", "pip"]
# the path to the icon of the stack
icon: /images/python.svg
links:
# The link to the repository of the project that contains the devfile.yaml with schemaVersion 2.x.y
v2: https://github.com/che-samples/python-hello-world/tree/main
```

The contents of the devfile registry are published to [GitHub pages](https://eclipse-che.github.io/che-devfile-registry/main/) on every commit. Furthermore, every version is also published to GitHub pages at release time. As an example the `7.31.2` version of the devfile registry was published [here](https://eclipse-che.github.io/che-devfile-registry/7.31.2/).

Expand Down
13 changes: 6 additions & 7 deletions build/dockerfiles/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ INDEX_JSON="${DEVFILES_DIR}/index.json"

# Regex used to break an image reference into groups:
# \1 - Whitespace and (optional) quotation preceding image reference
# \2 - Registry portion of image, e.g. (quay.io)/eclipse/che-theia:tag
# \3 - Organization portion of image, e.g. quay.io/(eclipse)/che-theia:tag
# \4 - Image name portion of image, e.g. quay.io/eclipse/(che-theia):tag
# \5 - Optional image digest identifier (empty for tags), e.g. quay.io/eclipse/che-theia(@sha256):digest
# \6 - Tag of image or digest, e.g. quay.io/eclipse/che-theia:(tag)
# \2 - Registry portion of image, e.g. (quay.io)/che-incubator/che-code:tag
# \3 - Organization portion of image, e.g. quay.io/(che-incubator)/che-code:tag
# \4 - Image name portion of image, e.g. quay.io/che-incubator/(che-code):tag
# \5 - Optional image digest identifier (empty for tags), e.g. quay.io/che-incubator/che-code(@sha256):digest
# \6 - Tag of image or digest, e.g. quay.io/che-incubator/che-code:(tag)
# \7 - Optional quotation following image reference
IMAGE_REGEX='([[:space:]]*"?)([._:a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*)(@sha256)?:([._a-zA-Z0-9-]*)("?)'

Expand Down Expand Up @@ -147,10 +147,9 @@ if [ -n "$PUBLIC_URL" ]; then
PUBLIC_URL=${PUBLIC_URL%/}
sed -i "s|{{ DEVFILE_REGISTRY_URL }}|${PUBLIC_URL}|" "${devfiles[@]}" "${metas[@]}" "${templates[@]}" "$INDEX_JSON"

# Add PUBLIC_URL at the begining of 'icon' field and links ('self', 'eclipse/che-theia/latest')
# Add PUBLIC_URL at the begining of 'icon' field and links ('self', 'che-incubator/che-code/latest')
sed -i "s|\"icon\": \"/images/|\"icon\": \"${PUBLIC_URL}/images/|" "$INDEX_JSON"
sed -i "s|\"self\": \"/devfiles/|\"self\": \"${PUBLIC_URL}/devfiles/|" "$INDEX_JSON"
sed -i "s|\"eclipse/che-theia/latest\": \"/devfiles/|\"eclipse/che-theia/latest\": \"${PUBLIC_URL}/devfiles/|" "$INDEX_JSON"
sed -i "s|\"che-incubator/che-code/insiders\": \"/devfiles/|\"che-incubator/che-code/insiders\": \"${PUBLIC_URL}/devfiles/|" "$INDEX_JSON"
sed -i "s|\"che-incubator/che-code/latest\": \"/devfiles/|\"che-incubator/che-code/latest\": \"${PUBLIC_URL}/devfiles/|" "$INDEX_JSON"
else
Expand Down
6 changes: 0 additions & 6 deletions build/scripts/generate_devworkspace_templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ do
--output-file:"${dir}"/devworkspace-che-code-latest.yaml \
--project."${project}"

npm_config_yes=true npx @eclipse-che/che-devworkspace-generator@${CHE_DEVWORKSPACE_GENERATOR_VERSION} \
--devfile-url:"${devfile_url}" \
--editor-entry:eclipse/che-theia/latest \
--output-file:"${dir}"/devworkspace-che-theia-latest.yaml \
--project."${project}"

npm_config_yes=true npx @eclipse-che/che-devworkspace-generator@${CHE_DEVWORKSPACE_GENERATOR_VERSION} \
--devfile-url:"${devfile_url}" \
--editor-entry:che-incubator/che-idea/next \
Expand Down
5 changes: 2 additions & 3 deletions build/scripts/index.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2018-2022 Red Hat, Inc.
# Copyright (c) 2018-2023 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
Expand All @@ -18,8 +18,7 @@ for meta in "${metas[@]}"; do
# Ignore double quotes warning for yq expression
# shellcheck disable=SC2016,SC2094
cat <<< "$(yq -y --arg metadir "${META_DIR}" '.links.devWorkspaces |= . +
{"eclipse/che-theia/latest": "/\($metadir)/devworkspace-che-theia-latest.yaml",
"eclipse/che-idea/next": "/\($metadir)/devworkspace-che-idea-next.yaml",
{"che-incubator/che-idea/next": "/\($metadir)/devworkspace-che-idea-next.yaml",
"che-incubator/che-code/latest": "/\($metadir)/devworkspace-che-code-latest.yaml",
"che-incubator/che-code/insiders": "/\($metadir)/devworkspace-che-code-insiders.yaml",}' "${meta}")" > "${meta}"
fi
Expand Down
Loading