-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #489 from che-incubator/artifactsyaml
chore: Generate artifacts.lock.yaml on rebase
- Loading branch information
Showing
3 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
metadata: | ||
version: "1.0" | ||
artifacts: | ||
# ms-vscode.js-debug-companion | ||
- download_url: https://github.com/microsoft/vscode-js-debug-companion/releases/download/v1.1.3/ms-vscode.js-debug-companion.1.1.3.vsix | ||
filename: ms-vscode.js-debug-companion.1.1.3.vsix | ||
checksum: sha256:7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93 | ||
# ms-vscode.js-debug | ||
- download_url: https://github.com/microsoft/vscode-js-debug/releases/download/v1.96.0/ms-vscode.js-debug.1.96.0.vsix | ||
filename: ms-vscode.js-debug.1.96.0.vsix | ||
checksum: sha256:278cd8b129c133d834a8105d0e0699f2f940c5c159fa5c821c7b9a4f7ffd3581 | ||
# ms-vscode.vscode-js-profile-table | ||
- download_url: https://github.com/microsoft/vscode-js-profile-visualizer/releases/download/v1.0.10/ms-vscode.vscode-js-profile-table.1.0.10.vsix | ||
filename: ms-vscode.vscode-js-profile-table.1.0.10.vsix | ||
checksum: sha256:7361748ddf9fd09d8a2ed1f2a2d7376a2cf9aae708692820b799708385c38e08 | ||
# ripgrep-ppc64le | ||
- download_url: https://github.com/microsoft/ripgrep-prebuilt/releases/download/v13.0.0-4/ripgrep-v13.0.0-4-powerpc64le-unknown-linux-gnu.tar.gz | ||
filename: ripgrep-ppc64le | ||
checksum: sha256:https://github.com/microsoft/ripgrep-prebuilt/releases/download/v13.0.0-4/ripgrep-v13.0.0-4-powerpc64le-unknown-linux-gnu.tar.gz | ||
# ripgrep-s390x | ||
- download_url: https://github.com/microsoft/ripgrep-prebuilt/releases/download/v13.0.0-4/ripgrep-v13.0.0-4-s390x-unknown-linux-gnu.tar.gz | ||
filename: ripgrep-s390x | ||
checksum: sha256:https://github.com/microsoft/ripgrep-prebuilt/releases/download/v13.0.0-4/ripgrep-v13.0.0-4-s390x-unknown-linux-gnu.tar.gz | ||
# ripgrep-x86_64 | ||
- download_url: https://github.com/microsoft/ripgrep-prebuilt/releases/download/v13.0.0-10/ripgrep-v13.0.0-10-x86_64-unknown-linux-musl.tar.gz | ||
filename: ripgrep-x86_64 | ||
checksum: sha256:https://github.com/microsoft/ripgrep-prebuilt/releases/download/v13.0.0-10/ripgrep-v13.0.0-10-x86_64-unknown-linux-musl.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2022-2024 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/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Red Hat, Inc. - initial API and implementation | ||
|
||
set -e | ||
|
||
SCRIPT_DIR=$(dirname "$0") | ||
ROOT_DIR=$(realpath "$SCRIPT_DIR/../..") | ||
ARTIFACTS_LOCK_YAML="$SCRIPT_DIR/artifacts.lock.yaml" | ||
|
||
run () { | ||
rm -f $ARTIFACTS_LOCK_YAML | ||
|
||
echo "---" >> "$ARTIFACTS_LOCK_YAML" | ||
echo "metadata:" >> "$ARTIFACTS_LOCK_YAML" | ||
echo " version: \"1.0\"" >> "$ARTIFACTS_LOCK_YAML" | ||
echo "artifacts:" >> "$ARTIFACTS_LOCK_YAML" | ||
|
||
# Generate artifacts for built-in extensions | ||
PRODUCT_JSON="$ROOT_DIR/code/product.json" | ||
PLUGINS=$(jq -r '.builtInExtensions[] | .name' "$PRODUCT_JSON") | ||
for PLUGIN in $PLUGINS; do | ||
VERSION=$(jq -r '.builtInExtensions[] | select(.name=="'${PLUGIN}'") | .version' "$PRODUCT_JSON") | ||
REPOSITORY=$(jq -r '.builtInExtensions[] | select(.name=="'${PLUGIN}'") | .repo' "$PRODUCT_JSON") | ||
SHA256=$(jq -r '.builtInExtensions[] | select(.name=="'${PLUGIN}'") | .sha256' "$PRODUCT_JSON") | ||
|
||
if [[ ! $SHA256 == "null" ]]; then | ||
FILENAME="$PLUGIN.$VERSION.vsix" | ||
DOWNLOAD_URL="$REPOSITORY/releases/download/v$VERSION/$FILENAME" | ||
check_existance "$DOWNLOAD_URL" | ||
|
||
echo " # $PLUGIN" >> "$ARTIFACTS_LOCK_YAML" | ||
echo " - download_url: $DOWNLOAD_URL" >> "$ARTIFACTS_LOCK_YAML" | ||
echo " filename: $FILENAME" >> "$ARTIFACTS_LOCK_YAML" | ||
echo " checksum: sha256:$SHA256" >> "$ARTIFACTS_LOCK_YAML" | ||
fi | ||
done | ||
|
||
# Generate artifacts for ripgrep dependency | ||
PACKAGE_LOCK_JSON="$ROOT_DIR/code/package-lock.json" | ||
VSCODE_RIPGREP_VERSION=$(grep '"node_modules/@vscode/ripgrep"' "$PACKAGE_LOCK_JSON" -A 2 | grep '"version"' | head -1 | cut -d '"' -f 4) | ||
POST_INSTALL_SCRIPT=$(curl -sSL https://raw.githubusercontent.com/microsoft/vscode-ripgrep/v${VSCODE_RIPGREP_VERSION}/lib/postinstall.js) | ||
VSIX_RIPGREP_PREBUILT_VERSION=$(echo "${POST_INSTALL_SCRIPT}" | grep "const VERSION" | cut -d"'" -f 2 ) | ||
VSIX_RIPGREP_PREBUILT_MULTIARCH_VERSION=$(echo "${POST_INSTALL_SCRIPT}" | grep "const MULTI_ARCH_LINUX_VERSION" | cut -d"'" -f 2 ) | ||
|
||
PLATFORMS=("ppc64le" "s390x" "x86_64") | ||
for PLATFORM in "${PLATFORMS[@]}"; do | ||
FILENAME="ripgrep-$PLATFORM" | ||
|
||
case $PLATFORM in | ||
'ppc64le') RG_ARCH_SUFFIX='powerpc64le-unknown-linux-gnu';; | ||
's390x') RG_ARCH_SUFFIX='s390x-unknown-linux-gnu';; | ||
'x86_64') RG_ARCH_SUFFIX='x86_64-unknown-linux-musl';; | ||
esac | ||
case $PLATFORM in | ||
'ppc64le' | 's390x') RG_VERSION=${VSIX_RIPGREP_PREBUILT_MULTIARCH_VERSION};; | ||
'x86_64') RG_VERSION="${VSIX_RIPGREP_PREBUILT_VERSION}";; | ||
esac | ||
|
||
DOWNLOAD_URL="https://github.com/microsoft/ripgrep-prebuilt/releases/download/${RG_VERSION}/ripgrep-${RG_VERSION}-${RG_ARCH_SUFFIX}.tar.gz" | ||
check_existance "$DOWNLOAD_URL" | ||
|
||
echo " # $FILENAME" >> "$ARTIFACTS_LOCK_YAML" | ||
echo " - download_url: $DOWNLOAD_URL" >> "$ARTIFACTS_LOCK_YAML" | ||
echo " filename: $FILENAME" >> "$ARTIFACTS_LOCK_YAML" | ||
echo " checksum: sha256:$DOWNLOAD_URL" >> "$ARTIFACTS_LOCK_YAML" | ||
done | ||
|
||
echo "[INFO] Done" | ||
} | ||
|
||
check_existance() { | ||
if curl -sfILo/dev/null "$1"; then | ||
echo "[INFO] Valid url: $1" | ||
else | ||
echo "[ERROR] Invalid url: $1" | ||
exit 1 | ||
fi | ||
} | ||
|
||
run |