diff --git a/.github/workflows/jetbrains-auto-update-template.yml b/.github/workflows/jetbrains-auto-update-template.yml index ae5d83ae05a311..7948ae62b91a75 100644 --- a/.github/workflows/jetbrains-auto-update-template.yml +++ b/.github/workflows/jetbrains-auto-update-template.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '1.19' + go-version: "1.19" - name: Download leeway run: cd /usr/local/bin && curl -fsSL https://github.com/gitpod-io/leeway/releases/download/v0.4.1/leeway_0.4.1_Linux_x86_64.tar.gz | tar xz - name: Download golangci-lint @@ -52,18 +52,21 @@ jobs: run: | curl -sL "https://data.services.jetbrains.com/products/releases?code=${{ inputs.productCode }}&type=eap,rc,release&platform=linux" > releases.json IDE_VERSION=$(cat releases.json | jq -r -c 'first(.${{ inputs.productCode }}[] | select(.build | contains("${{ steps.platform-version.outputs.result }}")) | .build)') + IDE_BACKEND_VERSION=$(cat releases.json | jq -r '.${{ inputs.productCode }}[0].version') rm releases.json echo "::set-output name=result::$IDE_VERSION" + echo "::set-output name=ideBackendVersion::$IDE_BACKEND_VERSION" echo $IDE_VERSION + echo $IDE_BACKEND_VERSION - name: Leeway build if: ${{ steps.ide-version.outputs.result }} env: - LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: '8388608' + LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: "8388608" run: | gcloud auth configure-docker --quiet export LEEWAY_WORKSPACE_ROOT=$(pwd) cd components/ide/jetbrains/image - leeway build -Dversion=latest -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DbuildNumber=${{ steps.ide-version.outputs.result }} .:${{ inputs.productId }}-latest + leeway build -Dversion=latest -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DbuildNumber=${{ steps.ide-version.outputs.result }} .:${{ inputs.productId }}-latest -DjbBackendVersion=${{ steps.ide-version.outputs.ideBackendVersion }} - name: Get previous job's status id: lastrun uses: filiptronicek/get-last-job-status@main diff --git a/WORKSPACE.yaml b/WORKSPACE.yaml index 2d0e9e78ef138b..e8d682d1293b14 100644 --- a/WORKSPACE.yaml +++ b/WORKSPACE.yaml @@ -19,6 +19,7 @@ defaultArgs: webstormDownloadUrl: "https://download.jetbrains.com/webstorm/WebStorm-2022.2.3.tar.gz" riderDownloadUrl: "https://download.jetbrains.com/rider/JetBrains.Rider-2022.2.4.tar.gz" clionDownloadUrl: "https://download.jetbrains.com/cpp/CLion-2022.2.4.tar.gz" + jbBackendVersion: "latest" REPLICATED_API_TOKEN: "" REPLICATED_APP: "" provenance: diff --git a/components/ide/jetbrains/image/BUILD.js b/components/ide/jetbrains/image/BUILD.js index f028264022623a..ffddfed12410e2 100644 --- a/components/ide/jetbrains/image/BUILD.js +++ b/components/ide/jetbrains/image/BUILD.js @@ -37,6 +37,16 @@ const ideConfigs = [ }, ]; +const getIDEVersion = function (qualifier, url) { + if (qualifier == "latest") { + return args.jbBackendVersion; + } else { + // https://download.jetbrains.com/idea/ideaIU-2022.2.4.tar.gz + const str = url.split("-"); + return str[str.length - 1].replace(".tar.gz", ""); + } +}; + const packages = []; const generateIDEBuildPackage = function (ideConfig, qualifier) { let name = ideConfig.name + (qualifier === "stable" ? "" : "-" + qualifier); @@ -55,6 +65,7 @@ const generateIDEBuildPackage = function (ideConfig, qualifier) { JETBRAINS_DOWNLOAD_QUALIFIER: name, SUPERVISOR_IDE_CONFIG: `supervisor-ide-config_${ideConfig.name}.json`, JETBRAINS_BACKEND_QUALIFIER: qualifier, + JETBRAINS_BACKEND_VERSION: getIDEVersion(qualifier, args[`${ideConfig.name}DownloadUrl`]), }, image: [], }, diff --git a/components/ide/jetbrains/image/leeway.Dockerfile b/components/ide/jetbrains/image/leeway.Dockerfile index 6b672c7e47e8cb..cb706342502a70 100644 --- a/components/ide/jetbrains/image/leeway.Dockerfile +++ b/components/ide/jetbrains/image/leeway.Dockerfile @@ -10,6 +10,7 @@ RUN mkdir /ide-desktop FROM scratch ARG JETBRAINS_DOWNLOAD_QUALIFIER ARG JETBRAINS_BACKEND_QUALIFIER +ARG JETBRAINS_BACKEND_VERSION ARG SUPERVISOR_IDE_CONFIG # ensures right permissions for /ide-desktop COPY --from=base_builder --chown=33333:33333 /ide-desktop/ /ide-desktop/ @@ -30,3 +31,5 @@ ENV GITPOD_ENV_SET_GP_OPEN_EDITOR "$GITPOD_ENV_SET_EDITOR" ENV GITPOD_ENV_SET_GIT_EDITOR "$GITPOD_ENV_SET_EDITOR --wait" ENV GITPOD_ENV_SET_GP_PREVIEW_BROWSER "/ide-desktop/bin/idea-cli preview" ENV GITPOD_ENV_SET_GP_EXTERNAL_BROWSER "/ide-desktop/bin/idea-cli preview" + +LABEL "io.gitpod.ide.version"=$JETBRAINS_BACKEND_VERSION