@@ -188,20 +188,6 @@ type WorkspaceContext struct {
188
188
ReferrerIde string `json:"referrerIde,omitempty"`
189
189
}
190
190
191
- var JetbrainsCode map [string ]string
192
-
193
- func init () {
194
- JetbrainsCode = make (map [string ]string )
195
- JetbrainsCode ["intellij" ] = "IIU"
196
- JetbrainsCode ["goland" ] = "GO"
197
- JetbrainsCode ["pycharm" ] = "PCP"
198
- JetbrainsCode ["phpstorm" ] = "PS"
199
- JetbrainsCode ["rubymine" ] = "RM"
200
- JetbrainsCode ["webstorm" ] = "WS"
201
- JetbrainsCode ["rider" ] = "RD"
202
- JetbrainsCode ["clion" ] = "CL"
203
- }
204
-
205
191
func (s * IDEServiceServer ) resolveReferrerIDE (ideConfig * config.IDEConfig , wsCtx * WorkspaceContext , chosenIDEName string ) (ideName string , ideOption * config.IDEOption ) {
206
192
if wsCtx == nil || wsCtx .Referrer == "" {
207
193
return
@@ -365,55 +351,19 @@ func (s *IDEServiceServer) ResolveWorkspaceConfig(ctx context.Context, req *api.
365
351
if prebuilds .Version != "latest" {
366
352
template := `
367
353
echo 'warming up stable release of ${key}...'
368
- echo 'downloading stable ${key} backend...'
369
- mkdir /tmp/backend
370
- curl -sSLo /tmp/backend/backend.tar.gz "https://download.jetbrains.com/product?type=release&distribution=linux&code=${productCode}"
371
- tar -xf /tmp/backend/backend.tar.gz --strip-components=1 --directory /tmp/backend
372
-
373
- echo 'configuring JB system config and caches aligned with runtime...'
374
- printf '\nshared.indexes.download.auto.consent=true' >> "/tmp/backend/bin/idea.properties"
375
- unset JAVA_TOOL_OPTIONS
376
- export IJ_HOST_CONFIG_BASE_DIR=/workspace/.config/JetBrains
377
- export IJ_HOST_SYSTEM_BASE_DIR=/workspace/.cache/JetBrains
378
-
379
- echo 'running stable ${key} backend in warmup mode...'
380
- /tmp/backend/bin/remote-dev-server.sh warmup "$GITPOD_REPO_ROOT"
381
-
382
- echo 'removing stable ${key} backend...'
383
- rm -rf /tmp/backend
354
+ JETBRAINS_BACKEND_QUALIFIER=stable /ide-desktop/${key}/status warmup ${key}
384
355
`
385
- if code , ok := JetbrainsCode [alias ]; ok {
386
- template = strings .ReplaceAll (template , "${key}" , alias )
387
- template = strings .ReplaceAll (template , "${productCode}" , code )
388
- warmUpTask += template
389
- }
356
+ template = strings .ReplaceAll (template , "${key}" , alias )
357
+ warmUpTask += template
390
358
}
391
359
392
360
if prebuilds .Version != "stable" {
393
361
template := `
394
- echo 'warming up latest release of ${key}...'
395
- echo 'downloading latest ${key} backend...'
396
- mkdir /tmp/backend-latest
397
- curl -sSLo /tmp/backend-latest/backend-latest.tar.gz "https://download.jetbrains.com/product?type=release,eap,rc&distribution=linux&code=${productCode}"
398
- tar -xf /tmp/backend-latest/backend-latest.tar.gz --strip-components=1 --directory /tmp/backend-latest
399
-
400
- echo 'configuring JB system config and caches aligned with runtime...'
401
- printf '\nshared.indexes.download.auto.consent=true' >> "/tmp/backend-latest/bin/idea.properties"
402
- unset JAVA_TOOL_OPTIONS
403
- export IJ_HOST_CONFIG_BASE_DIR=/workspace/.config/JetBrains-latest
404
- export IJ_HOST_SYSTEM_BASE_DIR=/workspace/.cache/JetBrains-latest
405
-
406
- echo 'running ${key} backend in warmup mode...'
407
- /tmp/backend-latest/bin/remote-dev-server.sh warmup "$GITPOD_REPO_ROOT"
408
-
409
- echo 'removing latest ${key} backend...'
410
- rm -rf /tmp/backend-latest
362
+ echo 'warming up stable release of ${key}...'
363
+ JETBRAINS_BACKEND_QUALIFIER=latest /ide-desktop/${key}-latest/status warmup ${key}
411
364
`
412
- if code , ok := JetbrainsCode [alias ]; ok {
413
- template = strings .ReplaceAll (template , "${key}" , alias )
414
- template = strings .ReplaceAll (template , "${productCode}" , code )
415
- warmUpTask += template
416
- }
365
+ template = strings .ReplaceAll (template , "${key}" , alias )
366
+ warmUpTask += template
417
367
}
418
368
}
419
369
}
0 commit comments