chore(dogfood): add a coder_app for JetBrains gateway IDEs (#9644)

This commit is contained in:
Muhammad Atif Ali 2023-09-13 17:49:36 +03:00 committed by GitHub
parent a229855e71
commit 254f459d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 104 additions and 1 deletions

View File

@ -71,6 +71,37 @@ data "coder_parameter" "region" {
# }
}
data "coder_parameter" "jetbrains_ide" {
type = "list(string)"
name = "jetbrains_ide"
display_name = "JetBrains IDE"
icon = "/icon/gateway.svg"
mutable = true
default = jsonencode([
"GO",
"232.9559.64",
"https://download.jetbrains.com/go/goland-2023.2.1.tar.gz"
])
option {
icon = "/icon/goland.svg"
name = "GoLand"
value = jsonencode([
"GO",
"232.9559.64",
"https://download.jetbrains.com/go/goland-2023.2.1.tar.gz"
])
}
option {
icon = "/icon/webstorm.svg"
name = "WebStorm"
value = jsonencode([
"WS",
"232.9559.54",
"https://download.jetbrains.com/webstorm/WebStorm-2023.2.1.tar.gz"
])
}
}
provider "docker" {
host = lookup(local.docker_host, data.coder_parameter.region.value)
}
@ -189,7 +220,6 @@ resource "coder_agent" "dev" {
repo_dir="$${repo_dir/#~\//$HOME\/}"
if [ ! -d "$repo_dir" ]; then
mkdir -p "$repo_dir"
git clone https://github.com/coder/coder "$repo_dir"
fi
@ -242,6 +272,15 @@ resource "coder_app" "filebrowser" {
share = "owner"
}
resource "coder_app" "gateway" {
agent_id = coder_agent.dev.id
display_name = data.coder_parameter.jetbrains_ide.option[index(data.coder_parameter.jetbrains_ide.option.*.value, data.coder_parameter.jetbrains_ide.value)].name
slug = "gateway"
url = "jetbrains-gateway://connect#type=coder&workspace=${data.coder_workspace.me.name}&agent=dev&folder=${replace(data.coder_parameter.repo_dir.value, "/^~\\//", "/home/coder/")}&url=${data.coder_workspace.me.access_url}&token=${data.coder_workspace.me.owner_session_token}&ide_product_code=${jsondecode(data.coder_parameter.jetbrains_ide.value)[0]}&ide_build_number=${jsondecode(data.coder_parameter.jetbrains_ide.value)[1]}&ide_download_link=${jsondecode(data.coder_parameter.jetbrains_ide.value)[2]}"
icon = data.coder_parameter.jetbrains_ide.option[index(data.coder_parameter.jetbrains_ide.option.*.value, data.coder_parameter.jetbrains_ide.value)].icon
external = true
}
resource "docker_volume" "home_volume" {
name = "coder-${data.coder_workspace.me.id}-home"
# Protect the volume from being deleted due to changes in attributes.

View File

@ -0,0 +1,64 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M32 62L57.975 46.98V16.964L32 2L6.02602 16.964H6.02502L32 31.984V62Z" fill="url(#paint0_linear_1725:872)"/>
<path d="M57.975 16.964L32 2L6.02602 16.964H6.02502L32 31.984L57.975 16.964Z" fill="url(#paint1_linear_1725:872)"/>
<path d="M57.975 16.964L32 2L6.02602 16.964H6.02502L32 31.984L57.975 16.964Z" fill="url(#paint2_linear_1725:872)"/>
<path d="M57.975 16.964L32 2L6.02602 16.964H6.02502L32 31.984L57.975 16.964Z" fill="url(#paint3_linear_1725:872)"/>
<path d="M6.026 46.9799V16.9639L32 31.9839L6.026 46.9799Z" fill="url(#paint4_linear_1725:872)"/>
<path d="M32 31.9844L6.026 46.9804L32 62.0004V31.9844Z" fill="url(#paint5_linear_1725:872)" style="mix-blend-mode:overlay"/>
<path d="M32 61.9999L57.975 46.9799V16.9639L32 31.9839V61.9999Z" fill="url(#paint6_linear_1725:872)"/>
<path d="M32 61.9999L57.975 46.9799V16.9639L32 31.9839V61.9999Z" fill="url(#paint7_linear_1725:872)"/>
<path d="M32 61.9999L57.975 46.9799V16.9639L32 31.9839V61.9999Z" fill="url(#paint8_linear_1725:872)"/>
<g opacity="0.8">
<path d="M25.028 27.9699L32 32V2L6 16.972L25.028 27.9699Z" fill="url(#paint9_linear_1725:872)" style="mix-blend-mode:overlay"/>
</g>
<defs>
<linearGradient id="paint0_linear_1725:872" x1="17.0683" y1="11.5629" x2="61.3962" y2="55.8908" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#FDB60D"/>
<stop offset="0.54795" stop-color="#FF318C"/>
<stop offset="0.88765" stop-color="#6B57FF"/>
</linearGradient>
<linearGradient id="paint1_linear_1725:872" x1="25.5898" y1="28.0668" x2="28.4505" y2="23.112" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="white" stop-opacity="0.6"/>
<stop offset="0.08098" stop-color="#FFC524" stop-opacity="0.4"/>
<stop offset="0.70457" stop-color="#FFC524" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint2_linear_1725:872" x1="25.4334" y1="5.59024" x2="29.6963" y2="12.9738" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#F9ED32" stop-opacity="0.6"/>
<stop offset="0.19796" stop-color="#FFC524" stop-opacity="0.4"/>
<stop offset="0.70457" stop-color="#FFC524" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint3_linear_1725:872" x1="38.9129" y1="4.99057" x2="37.0135" y2="8.28029" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#FDB60D" stop-opacity="0.6"/>
<stop offset="0.23369" stop-color="#FDB60D" stop-opacity="0.4"/>
<stop offset="0.5185" stop-color="#FF318C" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint4_linear_1725:872" x1="6.02553" y1="31.972" x2="48.2774" y2="31.972" gradientUnits="userSpaceOnUse">
<stop offset="0.01477"/>
<stop offset="0.19258"/>
<stop offset="0.57156" stop-color="#6B57FF"/>
<stop offset="0.82576" stop-color="#FF318C"/>
</linearGradient>
<linearGradient id="paint5_linear_1725:872" x1="25.2369" y1="19.192" x2="18.7738" y2="55.8462" gradientUnits="userSpaceOnUse">
<stop offset="0.046628" stop-color="white" stop-opacity="0.86"/>
<stop offset="0.766654" stop-color="#CBCAA4" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint6_linear_1725:872" x1="32.0001" y1="39.4819" x2="38.997" y2="39.4819" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#FFB2FF" stop-opacity="0.6"/>
<stop offset="0.08098" stop-color="#D828FF" stop-opacity="0.4"/>
<stop offset="0.70457" stop-color="#FF318C" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint7_linear_1725:872" x1="58.0814" y1="39.4819" x2="50.9352" y2="39.4819" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="#6644FF" stop-opacity="0.8"/>
<stop offset="0.09676" stop-color="#6B57FF" stop-opacity="0.4"/>
<stop offset="0.70457" stop-color="#FF318C" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint8_linear_1725:872" x1="51.8655" y1="51.3952" x2="49.8093" y2="47.8337" gradientUnits="userSpaceOnUse">
<stop offset="0.00572" stop-color="#FF318C"/>
<stop offset="0.46934" stop-color="#6B57FF" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint9_linear_1725:872" x1="18.9999" y1="2.93734" x2="18.9999" y2="20.5615" gradientUnits="userSpaceOnUse">
<stop offset="0.23873" stop-color="#FF5592" stop-opacity="0.65"/>
<stop offset="0.8289" stop-color="#FF57E4" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB