Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: generate devworkspaces by devworkspace-generator tool #870

Merged
merged 3 commits into from
Jan 9, 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
2 changes: 2 additions & 0 deletions dependencies/che-devfile-registry/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
resources/
node_modules/
/root-local.tgz
package-lock.json
4 changes: 4 additions & 0 deletions dependencies/che-devfile-registry/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ function clear_generated_data() {
if [[ -f "$CHE_CODE_DW" ]]; then
rm "${CHE_CODE_DW}"
fi
CHE_IDEA_DW="${dir}/devworkspace-che-idea-latest.yaml"
if [[ -f "$CHE_IDEA_DW" ]]; then
rm "${CHE_IDEA_DW}"
fi
done
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ fi

arch="$(uname -m)"

# Install che-theia-devworkspace-handler
theia_devworkspace_handler="che-theia-devworkspace-handler"
npm install @eclipse-che/"${theia_devworkspace_handler}"@"$(jq -r --arg v $theia_devworkspace_handler '.[$v]' versions.json)"
# Install che-code-devworkspace-handler
code_devworkspace_handler="che-code-devworkspace-handler"
npm install @eclipse-che/"${code_devworkspace_handler}"@"$(jq -r --arg v $code_devworkspace_handler '.[$v]' versions.json)"
# Install che-devworkspace-generator
che_devworkspace_generator="che-devworkspace-generator"
npm install @eclipse-che/"${che_devworkspace_generator}"@"$(jq -r --arg v $che_devworkspace_generator '.[$v]' versions.json)"

mkdir -p ./resources/v2/
for dir in ./devfiles/*/
Expand All @@ -47,20 +44,31 @@ do
devfile_url=${devfile_url%\"*}
devfile_repo=${devfile_url%/tree*}
name=$(basename "${devfile_repo}")
project="${name}={{_INTERNAL_URL_}}/resources/v2/${name}.zip"

# Generate devworkspace-che-theia-latest.yaml
npm_config_yes=true npx @eclipse-che/${theia_devworkspace_handler} --devfile-url:"${devfile_url}" \
--editor:eclipse/che-theia/latest \
npm_config_yes=true npx @eclipse-che/${che_devworkspace_generator} \
--devfile-url:"${devfile_url}" \
--editor-entry:eclipse/che-theia/latest \
--plugin-registry-url:https://redhat-developer.github.io/devspaces/che-plugin-registry/"${VERSION}"/"${arch}"/v3 \
--output-file:"${dir}"devworkspace-che-theia-latest.yaml \
"--project.${name}={{INTERNAL_URL}}/resources/v2/${name}.zip"
--project."${project}"

# Generate devworkspace-che-code-insiders.yaml
npm_config_yes=true npx @eclipse-che/${code_devworkspace_handler} --devfile-url:"${devfile_url}" \
npm_config_yes=true npx @eclipse-che/${che_devworkspace_generator} \
--devfile-url:"${devfile_url}" \
--editor-entry:che-incubator/che-code/insiders \
--plugin-registry-url:https://redhat-developer.github.io/devspaces/che-plugin-registry/"${VERSION}"/"${arch}"/v3 \
--output-file:"${dir}"devworkspace-che-code-insiders.yaml \
"--project.${name}={{INTERNAL_URL}}/resources/v2/${name}.zip"
--project."${project}"

# Generate devworkspace-che-idea-latest.yaml
npm_config_yes=true npx @eclipse-che/${che_devworkspace_generator} \
--devfile-url:"${devfile_url}" \
--editor-entry:che-incubator/che-idea/latest \
--plugin-registry-url:https://redhat-developer.github.io/devspaces/che-plugin-registry/"${VERSION}"/"${arch}"/v3 \
--output-file:"${dir}"/devworkspace-che-idea-latest.yaml \
--project."${project}"

clone_and_zip "${devfile_repo}" "${devfile_url##*/}" "$(pwd)/resources/v2/$name.zip"
fi
Expand Down
1 change: 1 addition & 0 deletions dependencies/che-devfile-registry/build/scripts/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ for meta in "${metas[@]}"; do
# 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/latest": "/\($metadir)/devworkspace-che-idea-latest.yaml",
"che-incubator/che-code/insiders": "/\($metadir)/devworkspace-che-code-insiders.yaml",}' "${meta}")" > "${meta}"
fi
done
Expand Down
3 changes: 1 addition & 2 deletions dependencies/che-devfile-registry/versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"che-theia-devworkspace-handler": "0.0.1-1649678182",
"che-code-devworkspace-handler": "1.64.0-dev-210b722"
"che-devworkspace-generator": "0.0.1-c8bd5c0"
}