Skip to content

Commit 0fcc43a

Browse files
committed
enable indexing with latest GoLand in prebuilds as well
1 parent 118b31e commit 0fcc43a

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.gitpod.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ tasks:
4848
init: leeway exec --filter-type go -v -- go mod verify
4949
openMode: split-right
5050
- name: GoLand indexing
51-
init: ./scripts/goland-indexing.sh
51+
init: |
52+
./scripts/goland-indexing.sh
53+
./scripts/goland-indexing-latest.sh
5254
vscode:
5355
extensions:
5456
- bradlc.vscode-tailwindcss

scripts/goland-latest-indexing.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
# skip indexing in regular workspaces
4+
if [ ! "$GITPOD_HEADLESS" = "true" ] ; then exit ; fi
5+
6+
# resolve latest JetBrains backend version running by Gitpod
7+
productCode=GO
8+
curl -sSL "https://data.services.jetbrains.com/products?code=$productCode&fields=distributions%2Clink%2Cname%2Creleases&_=$(date +%s)000" > /tmp/jb_products.xml
9+
JB_BACKEND_DOWNLOAD_URL=$(jq -r '.[0].releases[0].downloads.linux.link' /tmp/jb_products.xml)
10+
echo "$JB_BACKEND_DOWNLOAD_URL"
11+
12+
# download JB backend
13+
mkdir /tmp/backend && cd /tmp/backend || exit 1
14+
curl -sSLo backend.tar.gz "$JB_BACKEND_DOWNLOAD_URL" && tar -xf backend.tar.gz --strip-components=1 && rm backend.tar.gz
15+
16+
# config JB system config and caches aligned with runtime
17+
printf '\nshared.indexes.download.auto.consent=true' >> "/tmp/backend/bin/idea.properties"
18+
unset JAVA_TOOL_OPTIONS
19+
export IJ_HOST_CONFIG_BASE_DIR=/workspace/.config/JetBrains-latest
20+
export IJ_HOST_SYSTEM_BASE_DIR=/workspace/.cache/JetBrains-latest
21+
22+
# start JB backend in indexing mode
23+
/tmp/backend/bin/remote-dev-server.sh warmup "$GITPOD_REPO_ROOT"

0 commit comments

Comments
 (0)