Skip to content

Commit 2dc912c

Browse files
committed
Dev via Gitpod Flex
1 parent 1cdbdf7 commit 2dc912c

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

Diff for: components/ide/jetbrains/toolbox/README.md

+37
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,43 @@
22

33
Provides a way to connect to Gitpod Classic workspaces within the JetBrains Toolbox App.
44

5+
## How to Develop with Gitpod Flex
6+
7+
- Connect to the environment via **JetBrains Gateway** (because we want to restart Toolbox) SSH feature (user: gitpod_devcontainer)
8+
- Copy flex-sync.sh locally and chmod +x
9+
- Exec `./flex-sync.sh <env_host>`
10+
11+
```sh
12+
#!/bin/bash
13+
# flex-sync.sh
14+
if [ $# -eq 0 ]; then
15+
echo "Usage: $0 <remote_host>"
16+
echo "Example: $0 01944f84-5bc8-7d9b-916a-4fc95e25de12.gitpod.environment"
17+
exit 1
18+
fi
19+
20+
REMOTE_HOST="$1"
21+
LOCAL_DIR="$HOME/Library/Caches/JetBrains/Toolbox/plugins"
22+
REMOTE_DIR="/workspace/gitpod/components/ide/jetbrains/toolbox/build/flex"
23+
DEVCONTAINER_HOST="gitpod_devcontainer@$REMOTE_HOST"
24+
25+
ssh $DEVCONTAINER_HOST "apt-get update && apt-get install -y rsync inotify-tools"
26+
27+
echo "Watching for changes in $DEVCONTAINER_HOST:$REMOTE_DIR"
28+
29+
ssh $DEVCONTAINER_HOST "inotifywait -m -r -e modify,create,delete,move $REMOTE_DIR" | \
30+
while read path action file; do
31+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Change detected: $action $file"
32+
rsync -avz --delete "$DEVCONTAINER_HOST:$REMOTE_DIR/" "$LOCAL_DIR/"
33+
34+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Change synced"
35+
pkill -f 'JetBrains Toolbox' || true
36+
echo debugClean > $HOME/Library/Logs/JetBrains/Toolbox/toolbox.log
37+
code $HOME/Library/Logs/JetBrains/Toolbox/toolbox.log
38+
open /Applications/JetBrains\ Toolbox.app
39+
done
40+
```
41+
542
## How to Develop
643

744
### Requires

Diff for: components/ide/jetbrains/toolbox/build.gradle.kts

+18
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,24 @@ val restartToolbox by tasks.creating {
146146
}
147147
}
148148

149+
val buildPluginFlex by tasks.creating(Sync::class.java) {
150+
group = "01.Gitpod"
151+
152+
dependsOn(tasks.named("shadowJar"))
153+
from(tasks.named("shadowJar").get().outputs.files)
154+
155+
val targetDir = Path.of("./build/flex") / pluginId
156+
157+
from("src/main/resources") {
158+
include("extension.json")
159+
include("dependencies.json")
160+
include("icon.svg")
161+
include("icon-gray.svg")
162+
}
163+
164+
into(targetDir)
165+
}
166+
149167
val copyPlugin by tasks.creating(Sync::class.java) {
150168
group = "01.Gitpod"
151169

0 commit comments

Comments
 (0)