Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/ide/jetbrains/image/create-supervisor-config.js
2499 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
// @ts-check
6
const fs = require("fs");
7
8
const ideConfigs = [
9
{
10
name: "intellij",
11
displayName: "IntelliJ IDEA",
12
},
13
{
14
name: "goland",
15
displayName: "GoLand",
16
},
17
{
18
name: "pycharm",
19
displayName: "PyCharm",
20
},
21
{
22
name: "phpstorm",
23
displayName: "PhpStorm",
24
},
25
{
26
name: "rubymine",
27
displayName: "RubyMine",
28
},
29
{
30
name: "webstorm",
31
displayName: "WebStorm",
32
},
33
{
34
name: "rider",
35
displayName: "Rider",
36
},
37
{
38
name: "clion",
39
displayName: "CLion",
40
},
41
{
42
name: "rustrover",
43
displayName: "RustRover",
44
},
45
];
46
47
["stable", "latest"].forEach((qualifier) => {
48
ideConfigs.forEach((ideConfig) => {
49
const name = ideConfig.name + (qualifier === "stable" ? "" : "-" + qualifier);
50
const template = {
51
name: ideConfig.name,
52
displayName: ideConfig.displayName,
53
version: qualifier,
54
entrypoint: `/ide-desktop/jb-launcher`,
55
entrypointArgs: ["{DESKTOPIDEPORT}", ideConfig.name, `Open in ${ideConfig.displayName}`],
56
readinessProbe: {
57
type: "http",
58
http: {
59
path: "/status",
60
},
61
},
62
env: {
63
JETBRAINS_BACKEND_QUALIFIER: qualifier,
64
PATH: `/ide-desktop/${name}/bin:$PATH`,
65
EDITOR: `/ide-desktop/${name}/bin/idea-cli open`,
66
VISUAL: "$EDITOR",
67
GP_OPEN_EDITOR: "$EDITOR",
68
GIT_EDITOR: "$EDITOR --wait",
69
GP_PREVIEW_BROWSER: `/ide-desktop/${name}/bin/idea-cli preview`,
70
GP_EXTERNAL_BROWSER: `/ide-desktop/${name}/bin/idea-cli preview`,
71
},
72
prebuild: {
73
args: ["warmup", ideConfig.name],
74
env: {
75
JETBRAINS_BACKEND_QUALIFIER: qualifier,
76
},
77
},
78
};
79
fs.writeFileSync(`supervisor-ide-config_${name}.json`, JSON.stringify(template, null, 2), "utf-8");
80
});
81
});
82
83