Skip to content

Commit f8bd8e7

Browse files
akosyakovroboquat
authored andcommitted
enable indexing with GoLand in prebuilds
1 parent 06bd515 commit f8bd8e7

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Diff for: .gitpod.yml

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ tasks:
4747
before: pre-commit install --install-hooks
4848
init: leeway exec --filter-type go -v -- go mod verify
4949
openMode: split-right
50+
- name: GoLand indexing
51+
init: ./scripts/goland-indexing.sh
5052
vscode:
5153
extensions:
5254
- bradlc.vscode-tailwindcss

Diff for: scripts/goland-indexing.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
# skip indexing in regular workspaces
4+
if [ ! "$GITPOD_HEADLESS" = "true" ] ; then exit ; fi
5+
6+
# resolve JetBrains backend version running by Gitpod
7+
curl https://raw.githubusercontent.com/gitpod-io/gitpod/main/WORKSPACE.yaml > /tmp/gitpod_workspace.yaml
8+
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
9+
sudo chmod a+x /usr/local/bin/yq
10+
JB_BACKEND_DOWNLOAD_URL=$(yq eval '.defaultArgs.golandDownloadUrl' /tmp/gitpod_workspace.yaml)
11+
echo "$JB_BACKEND_DOWNLOAD_URL"
12+
13+
# download JB backend
14+
mkdir /tmp/backend && cd /tmp/backend || exit 1
15+
curl -sSLo backend.tar.gz "$JB_BACKEND_DOWNLOAD_URL" && tar -xf backend.tar.gz --strip-components=1 && rm backend.tar.gz
16+
17+
# config JB system config and caches aligned with runtime
18+
printf '\nshared.indexes.download.auto.consent=true' >> "/tmp/backend/bin/idea.properties"
19+
unset JAVA_TOOL_OPTIONS
20+
export IJ_HOST_CONFIG_BASE_DIR=/workspace/.config/JetBrains
21+
export IJ_HOST_SYSTEM_BASE_DIR=/workspace/.cache/JetBrains
22+
23+
# start JB backend in indexing mode
24+
/tmp/backend/bin/remote-dev-server.sh warmup "$GITPOD_REPO_ROOT"

0 commit comments

Comments
 (0)