Skip to content

Commit 8dc44fb

Browse files
iQQBotmustard-mhfelladrinfiliptronicek
committed
Label JetBrains IDE images with their versions
Co-authored-by: mustard <mhqnwt@gmail.com> Co-authored-by: Victor Nogueira <victor@gitpod.io> Co-authored-by: Filip Troníček <filip@gitpod.io>
1 parent 00c77a9 commit 8dc44fb

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

.github/workflows/jetbrains-auto-update-template.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v2
2323
- uses: actions/setup-go@v2
2424
with:
25-
go-version: '1.19'
25+
go-version: "1.19"
2626
- name: Download leeway
2727
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
2828
- name: Download golangci-lint
@@ -52,18 +52,21 @@ jobs:
5252
run: |
5353
curl -sL "https://data.services.jetbrains.com/products/releases?code=${{ inputs.productCode }}&type=eap,rc,release&platform=linux" > releases.json
5454
IDE_VERSION=$(cat releases.json | jq -r -c 'first(.${{ inputs.productCode }}[] | select(.build | contains("${{ steps.platform-version.outputs.result }}")) | .build)')
55+
IDE_BACKEND_VERSION=$(cat releases.json | jq -r '.${{ inputs.productCode }}[0].version')
5556
rm releases.json
5657
echo "::set-output name=result::$IDE_VERSION"
58+
echo "::set-output name=ideBackendVersion::$IDE_BACKEND_VERSION"
5759
echo $IDE_VERSION
60+
echo $IDE_BACKEND_VERSION
5861
- name: Leeway build
5962
if: ${{ steps.ide-version.outputs.result }}
6063
env:
61-
LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: '8388608'
64+
LEEWAY_MAX_PROVENANCE_BUNDLE_SIZE: "8388608"
6265
run: |
6366
gcloud auth configure-docker --quiet
6467
export LEEWAY_WORKSPACE_ROOT=$(pwd)
6568
cd components/ide/jetbrains/image
66-
leeway build -Dversion=latest -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DbuildNumber=${{ steps.ide-version.outputs.result }} .:${{ inputs.productId }}-latest
69+
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 }}
6770
- name: Get previous job's status
6871
id: lastrun
6972
uses: filiptronicek/get-last-job-status@main

WORKSPACE.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ defaultArgs:
1919
webstormDownloadUrl: "https://download.jetbrains.com/webstorm/WebStorm-2022.2.3.tar.gz"
2020
riderDownloadUrl: "https://download.jetbrains.com/rider/JetBrains.Rider-2022.2.4.tar.gz"
2121
clionDownloadUrl: "https://download.jetbrains.com/cpp/CLion-2022.2.4.tar.gz"
22+
jbBackendVersion: "latest"
2223
REPLICATED_API_TOKEN: ""
2324
REPLICATED_APP: ""
2425
provenance:

components/ide/jetbrains/image/BUILD.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ const ideConfigs = [
3737
},
3838
];
3939

40+
const getIDEVersion = function (qualifier, url) {
41+
if (qualifier == "latest") {
42+
return args.jbBackendVersion;
43+
} else {
44+
// https://download.jetbrains.com/idea/ideaIU-2022.2.4.tar.gz
45+
const str = url.split("-");
46+
return str[str.length - 1].replace(".tar.gz", "");
47+
}
48+
};
49+
4050
const packages = [];
4151
const generateIDEBuildPackage = function (ideConfig, qualifier) {
4252
let name = ideConfig.name + (qualifier === "stable" ? "" : "-" + qualifier);
@@ -55,6 +65,7 @@ const generateIDEBuildPackage = function (ideConfig, qualifier) {
5565
JETBRAINS_DOWNLOAD_QUALIFIER: name,
5666
SUPERVISOR_IDE_CONFIG: `supervisor-ide-config_${ideConfig.name}.json`,
5767
JETBRAINS_BACKEND_QUALIFIER: qualifier,
68+
JETBRAINS_BACKEND_VERSION: getIDEVersion(qualifier, args[`${ideConfig.name}DownloadUrl`]),
5869
},
5970
image: [],
6071
},

components/ide/jetbrains/image/leeway.Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ RUN mkdir /ide-desktop
1010
FROM scratch
1111
ARG JETBRAINS_DOWNLOAD_QUALIFIER
1212
ARG JETBRAINS_BACKEND_QUALIFIER
13+
ARG JETBRAINS_BACKEND_VERSION
1314
ARG SUPERVISOR_IDE_CONFIG
1415
# ensures right permissions for /ide-desktop
1516
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"
3031
ENV GITPOD_ENV_SET_GIT_EDITOR "$GITPOD_ENV_SET_EDITOR --wait"
3132
ENV GITPOD_ENV_SET_GP_PREVIEW_BROWSER "/ide-desktop/bin/idea-cli preview"
3233
ENV GITPOD_ENV_SET_GP_EXTERNAL_BROWSER "/ide-desktop/bin/idea-cli preview"
34+
35+
LABEL "io.gitpod.ide.version"=$JETBRAINS_BACKEND_VERSION

0 commit comments

Comments
 (0)