Skip to content

Commit 773e9d4

Browse files
committed
include remote modules in testdata
1 parent 1fc310d commit 773e9d4

File tree

4 files changed

+515
-0
lines changed

4 files changed

+515
-0
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
display_name: JetBrains Gateway
3+
description: Add a one-click button to launch JetBrains Gateway IDEs in the dashboard.
4+
icon: ../.icons/gateway.svg
5+
maintainer_github: coder
6+
verified: true
7+
tags: [ide, jetbrains, helper, parameter]
8+
---
9+
10+
# JetBrains Gateway
11+
12+
This module adds a JetBrains Gateway Button to open any workspace with a single click.
13+
14+
```tf
15+
module "jetbrains_gateway" {
16+
count = data.coder_workspace.me.start_count
17+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
18+
version = "1.0.28"
19+
agent_id = coder_agent.example.id
20+
folder = "/home/coder/example"
21+
jetbrains_ides = ["CL", "GO", "IU", "PY", "WS"]
22+
default = "GO"
23+
}
24+
```
25+
26+
![JetBrains Gateway IDes list](../.images/jetbrains-gateway.png)
27+
28+
## Examples
29+
30+
### Add GoLand and WebStorm as options with the default set to GoLand
31+
32+
```tf
33+
module "jetbrains_gateway" {
34+
count = data.coder_workspace.me.start_count
35+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
36+
version = "1.0.28"
37+
agent_id = coder_agent.example.id
38+
folder = "/home/coder/example"
39+
jetbrains_ides = ["GO", "WS"]
40+
default = "GO"
41+
}
42+
```
43+
44+
### Use the latest version of each IDE
45+
46+
```tf
47+
module "jetbrains_gateway" {
48+
count = data.coder_workspace.me.start_count
49+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
50+
version = "1.0.28"
51+
agent_id = coder_agent.example.id
52+
folder = "/home/coder/example"
53+
jetbrains_ides = ["IU", "PY"]
54+
default = "IU"
55+
latest = true
56+
}
57+
```
58+
59+
### Use fixed versions set by `jetbrains_ide_versions`
60+
61+
```tf
62+
module "jetbrains_gateway" {
63+
count = data.coder_workspace.me.start_count
64+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
65+
version = "1.0.28"
66+
agent_id = coder_agent.example.id
67+
folder = "/home/coder/example"
68+
jetbrains_ides = ["IU", "PY"]
69+
default = "IU"
70+
latest = false
71+
jetbrains_ide_versions = {
72+
"IU" = {
73+
build_number = "243.21565.193"
74+
version = "2024.3"
75+
}
76+
"PY" = {
77+
build_number = "243.21565.199"
78+
version = "2024.3"
79+
}
80+
}
81+
}
82+
```
83+
84+
### Use the latest EAP version
85+
86+
```tf
87+
module "jetbrains_gateway" {
88+
count = data.coder_workspace.me.start_count
89+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
90+
version = "1.0.28"
91+
agent_id = coder_agent.example.id
92+
folder = "/home/coder/example"
93+
jetbrains_ides = ["GO", "WS"]
94+
default = "GO"
95+
latest = true
96+
channel = "eap"
97+
}
98+
```
99+
100+
### Custom base link
101+
102+
Due to the highest priority of the `ide_download_link` parameter in the `(jetbrains-gateway://...` within IDEA, the pre-configured download address will be overridden when using [IDEA's offline mode](https://www.jetbrains.com/help/idea/fully-offline-mode.html). Therefore, it is necessary to configure the `download_base_link` parameter for the `jetbrains_gateway` module to change the value of `ide_download_link`.
103+
104+
```tf
105+
module "jetbrains_gateway" {
106+
count = data.coder_workspace.me.start_count
107+
source = "registry.coder.com/modules/jetbrains-gateway/coder"
108+
version = "1.0.28"
109+
agent_id = coder_agent.example.id
110+
folder = "/home/coder/example"
111+
jetbrains_ides = ["GO", "WS"]
112+
releases_base_link = "https://releases.internal.site/"
113+
download_base_link = "https://download.internal.site/"
114+
default = "GO"
115+
}
116+
```
117+
118+
## Supported IDEs
119+
120+
This module and JetBrains Gateway support the following JetBrains IDEs:
121+
122+
- [GoLand (`GO`)](https://www.jetbrains.com/go/)
123+
- [WebStorm (`WS`)](https://www.jetbrains.com/webstorm/)
124+
- [IntelliJ IDEA Ultimate (`IU`)](https://www.jetbrains.com/idea/)
125+
- [PyCharm Professional (`PY`)](https://www.jetbrains.com/pycharm/)
126+
- [PhpStorm (`PS`)](https://www.jetbrains.com/phpstorm/)
127+
- [CLion (`CL`)](https://www.jetbrains.com/clion/)
128+
- [RubyMine (`RM`)](https://www.jetbrains.com/ruby/)
129+
- [Rider (`RD`)](https://www.jetbrains.com/rider/)
130+
- [RustRover (`RR`)](https://www.jetbrains.com/rust/)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { it, expect, describe } from "bun:test";
2+
import {
3+
runTerraformInit,
4+
testRequiredVariables,
5+
runTerraformApply,
6+
} from "../test";
7+
8+
describe("jetbrains-gateway", async () => {
9+
await runTerraformInit(import.meta.dir);
10+
11+
await testRequiredVariables(import.meta.dir, {
12+
agent_id: "foo",
13+
folder: "/home/foo",
14+
});
15+
16+
it("should create a link with the default values", async () => {
17+
const state = await runTerraformApply(import.meta.dir, {
18+
// These are all required.
19+
agent_id: "foo",
20+
folder: "/home/coder",
21+
});
22+
expect(state.outputs.url.value).toBe(
23+
"jetbrains-gateway://connect#type=coder&workspace=default&owner=default&folder=/home/coder&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=243.21565.193&ide_download_link=https://download.jetbrains.com/idea/ideaIU-2024.3.tar.gz",
24+
);
25+
26+
const coder_app = state.resources.find(
27+
(res) => res.type === "coder_app" && res.name === "gateway",
28+
);
29+
30+
expect(coder_app).not.toBeNull();
31+
expect(coder_app?.instances.length).toBe(1);
32+
expect(coder_app?.instances[0].attributes.order).toBeNull();
33+
});
34+
35+
it("default to first ide", async () => {
36+
const state = await runTerraformApply(import.meta.dir, {
37+
agent_id: "foo",
38+
folder: "/home/foo",
39+
jetbrains_ides: '["IU", "GO", "PY"]',
40+
});
41+
expect(state.outputs.identifier.value).toBe("IU");
42+
});
43+
});

0 commit comments

Comments
 (0)