Path: blob/main/components/ide/jetbrains/image/download.sh
2499 views
#!/bin/bash1# Copyright (c) 2022 Gitpod GmbH. All rights reserved.2# Licensed under the GNU Affero General Public License (AGPL).3# See License.AGPL.txt in the project root for license information.45mkdir backend && cd backend || exit67# get latest info from latest properties file for preview env8if [ "$PARSE_URL_FROM_LATEST_INFO" = "true" ]; then9TEMP_FILENAME=$(mktemp)10PLUGIN_PLATFORM_VERSION=$(grep platformVersion= "../components-ide-jetbrains-backend-plugin--latest-info/gradle-latest.properties" | sed 's/platformVersion=//' | sed 's/-EAP-CANDIDATE-SNAPSHOT//') # Example: PLUGIN_PLATFORM_VERSION: 223.75711112curl -sL "https://data.services.jetbrains.com/products/releases?code=$PRODUCT_CODE&type=eap,rc,release&platform=linux" > "$TEMP_FILENAME"13IDE_BUILD_VERSION=$(jq -r -c "first(.${PRODUCT_CODE}[] | select(.build | contains(\"$PLUGIN_PLATFORM_VERSION\")) | .build)" < "$TEMP_FILENAME") # Example: IDE_BUILD_VERSION: 223.7571.17614rm "$TEMP_FILENAME"1516if [ -n "$IDE_BUILD_VERSION" ]; then17JETBRAINS_BACKEND_URL="https://download.jetbrains.com/product?type=release,rc,eap&distribution=linux&code=$PRODUCT_CODE&build=$IDE_BUILD_VERSION"18else19JETBRAINS_BACKEND_URL="https://download.jetbrains.com/product?type=release,rc,eap&distribution=linux&code=$PRODUCT_CODE"20fi21fi2223echo "Downloading from $JETBRAINS_BACKEND_URL"2425curl -sSLo backend.tar.gz "$JETBRAINS_BACKEND_URL" && tar -xf backend.tar.gz --strip-components=1 && rm backend.tar.gz26# enable shared indexes by default27printf '\nshared.indexes.download.auto.consent=true' >> "bin/idea.properties"282930