Skip to content

Label JetBrains IDE images with their versions #15082

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

Merged
merged 1 commit into from
Dec 2, 2022
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
9 changes: 6 additions & 3 deletions .github/workflows/jetbrains-auto-update-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions WORKSPACE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions components/ide/jetbrains/image/BUILD.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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: [],
},
Expand Down
3 changes: 3 additions & 0 deletions components/ide/jetbrains/image/leeway.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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