Skip to content

Commit 2e14b6a

Browse files
committed
docs: update JetBrains preinstall template for dynamic IDE installation and versioning
1 parent 449d836 commit 2e14b6a

File tree

1 file changed

+19
-43
lines changed

1 file changed

+19
-43
lines changed

docs/admin/templates/extending-templates/jetbrains-preinstall.md

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rm -rf ~/JetBrains/backends/IU/*.tar.gz
3535
Add the following command to your template's `startup_script`:
3636

3737
```shell
38-
~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway
38+
~/JetBrains/*/bin/remote-dev-server.sh registerBackendLocationForGateway
3939
```
4040

4141
## Configure JetBrains Gateway Module
@@ -46,24 +46,24 @@ If you are using our [jetbrains-gateway](https://registry.coder.com/modules/code
4646
module "jetbrains_gateway" {
4747
count = data.coder_workspace.me.start_count
4848
source = "registry.coder.com/modules/jetbrains-gateway/coder"
49-
version = "1.0.28"
49+
version = "1.0.29"
5050
agent_id = coder_agent.main.id
5151
folder = "/home/coder/example"
5252
jetbrains_ides = ["IU"]
5353
default = "IU"
5454
latest = false
5555
jetbrains_ide_versions = {
5656
"IU" = {
57-
build_number = "243.26053.27"
58-
version = "2024.3"
57+
build_number = "251.25410.129"
58+
version = "2025.1"
5959
}
6060
}
6161
}
6262
6363
resource "coder_agent" "main" {
6464
...
6565
startup_script = <<-EOF
66-
~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway
66+
~/JetBrains/*/bin/remote-dev-server.sh registerBackendLocationForGateway
6767
EOF
6868
}
6969
```
@@ -73,45 +73,21 @@ resource "coder_agent" "main" {
7373
If you are using Docker based workspaces, you can add the command to your Dockerfile:
7474

7575
```dockerfile
76-
FROM ubuntu
77-
78-
# Combine all apt operations in a single RUN command
79-
# Install only necessary packages
80-
# Clean up apt cache in the same layer
81-
RUN apt-get update \
82-
&& apt-get install -y --no-install-recommends \
83-
curl \
84-
git \
85-
golang \
86-
sudo \
87-
vim \
88-
wget \
89-
&& apt-get clean \
90-
&& rm -rf /var/lib/apt/lists/*
91-
92-
# Create user in a single layer
93-
ARG USER=coder
94-
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
95-
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
96-
&& chmod 0440 /etc/sudoers.d/${USER}
97-
98-
USER ${USER}
99-
WORKDIR /home/${USER}
100-
101-
# Install JetBrains Gateway in a single RUN command to reduce layers
102-
# Download, extract, use, and clean up in the same layer
76+
FROM codercom/enterprise-base:ubuntu
77+
78+
# JetBrains IDE installation (configurable)
79+
ARG IDE_CODE=IU
80+
ARG IDE_VERSION=2025.1
81+
82+
# Fetch and install IDE dynamically
10383
RUN mkdir -p ~/JetBrains \
104-
&& wget -q https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -P /tmp \
105-
&& tar -xzf /tmp/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -C /tmp \
106-
&& /tmp/jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader \
107-
--products-filter IU \
108-
--build-filter 243.26053.27 \
109-
--platforms-filter linux-x64 \
110-
--download-backends ~/JetBrains \
111-
&& tar -xzf ~/JetBrains/backends/IU/*.tar.gz -C ~/JetBrains/backends/IU \
112-
&& rm -f ~/JetBrains/backends/IU/*.tar.gz \
113-
&& rm -rf /tmp/jetbrains-clients-downloader-linux-x86_64-1867* \
114-
&& rm -rf /tmp/*.tar.gz
84+
&& IDE_URL=$(curl -s "https://data.services.jetbrains.com/products/releases?code=${IDE_CODE}&majorVersion=${IDE_VERSION}&latest=true" | jq -r ".${IDE_CODE}[0].downloads.linux.link") \
85+
&& IDE_NAME=$(curl -s "https://data.services.jetbrains.com/products/releases?code=${IDE_CODE}&majorVersion=${IDE_VERSION}&latest=true" | jq -r ".${IDE_CODE}[0].name") \
86+
&& echo "Installing ${IDE_NAME}..." \
87+
&& wget -q ${IDE_URL} -P /tmp \
88+
&& tar -xzf /tmp/$(basename ${IDE_URL}) -C ~/JetBrains \
89+
&& rm -f /tmp/$(basename ${IDE_URL}) \
90+
&& echo "${IDE_NAME} installed successfully"
11591
```
11692

11793
## Next steps

0 commit comments

Comments
 (0)