-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
755 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
data "coder_parameter" "vscode_extension_spring" { | ||
name = "vscode_extensions_spring" | ||
display_name = "VS Code Extension Spring tools" | ||
type = "bool" | ||
default = false | ||
mutable = true | ||
} | ||
data "coder_parameter" "vscode_extension_k8s" { | ||
name = "vscode_extensions_k8s" | ||
display_name = "VS Code Extension Kubernetes" | ||
type = "bool" | ||
icon = "/icon/k8s.png" | ||
default = false | ||
mutable = true | ||
} | ||
data "coder_parameter" "vscode_extension_docker" { | ||
name = "vscode_extensions_docker" | ||
display_name = "VS Code Extension Docker" | ||
type = "bool" | ||
icon = "/icon/docker.png" | ||
default = false | ||
mutable = true | ||
} | ||
|
||
module "code-server" { | ||
source = "https://registry.coder.com/modules/code-server" | ||
agent_id = coder_agent.devbox.id | ||
install_version = "4.18.0" | ||
extensions = setunion( | ||
toset( data.coder_parameter.vscode_extension_docker.value ? ["ms-azuretools.vscode-docker"] : []), | ||
toset( data.coder_parameter.vscode_extension_spring.value ? ["vmware.vscode-boot-dev-pack"] : []), | ||
toset( data.coder_parameter.vscode_extension_k8s.value ? ["ms-kubernetes-tools.vscode-kubernetes-tools"] : []) | ||
) | ||
} | ||
|
||
resource "coder_script" "vscode_desktop_extensions" { | ||
count = var.desktop_setup ? 1 : 0 | ||
agent_id = coder_agent.devbox.id | ||
run_on_start = true | ||
display_name = "Install VS Code Desktop Extensions" | ||
icon = "/icon/code.svg" | ||
script = <<-EOF | ||
#!/bin/bash | ||
set -e | ||
if [[ "${data.coder_parameter.vscode_extension_spring.value}" == "true" ]]; then | ||
echo "Install VS Code Spring tools" | ||
code --force --install-extension vmware.vscode-boot-dev-pack 2> /dev/null | ||
fi | ||
if [[ "${data.coder_parameter.vscode_extension_k8s.value}" == "true" ]]; then | ||
echo "Install VS Code Kubernetes tools" | ||
code --force --install-extension ms-kubernetes-tools.vscode-kubernetes-tools 2> /dev/null | ||
fi | ||
if [[ "${data.coder_parameter.vscode_extension_docker.value}" == "true" ]]; then | ||
echo "Install VS Code Docker tools" | ||
code --force --install-extension ms-azuretools.vscode-docker 2> /dev/null | ||
fi | ||
EOF | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
data "coder_parameter" "intellij_c" { | ||
count = var.desktop_setup ? 1 : 0 | ||
name = "intellij-c" | ||
type = "bool" | ||
default = false | ||
display_name = "Intellij Community" | ||
mutable = true | ||
icon = "/icon/intellij.svg" | ||
} | ||
|
||
# https://www.jetbrains.com/idea/download/#section=linux | ||
resource "coder_script" "intellij_c" { | ||
count = var.desktop_setup && try(data.coder_parameter.intellij_c.0.value, false) ? 1 : 0 | ||
agent_id = coder_agent.devbox.id | ||
run_on_start = true | ||
display_name = "Intellij Community" | ||
icon = "/icon/intellij.svg" | ||
script = <<-EOF | ||
#!/bin/bash | ||
set -e | ||
if [[ ! -d ~/apps/intellij-c ]]; then | ||
echo "Setup Intellij Community" | ||
mkdir -p ~/apps | ||
mkdir -p /tmp/idea-c | ||
cd /tmp/idea-c | ||
echo "Downloading Intellij Community" | ||
wget -qO idea.tar.gz https://download.jetbrains.com/idea/ideaIC-2023.2.5.tar.gz | ||
echo "Extracting Intellij Community" | ||
tar xzf idea.tar.gz | ||
mv idea-* ~/apps/intellij-c; \ | ||
rm -rf /tmp/idea-c | ||
echo "Create desktop launcher for Intellij Ultimate" | ||
echo "[Desktop Entry] | ||
Comment[en_US]= | ||
Comment= | ||
Exec=~/apps/intellij-c/bin/idea.sh | ||
GenericName[en_US]= | ||
GenericName= | ||
Icon=/home/coder/apps/intellij-c/bin/idea.svg | ||
MimeType= | ||
Name[en_US]=IntelliJ Community | ||
Name=IDEA IntelliJ Community | ||
Path= | ||
StartupNotify=true | ||
Terminal=false | ||
TerminalOptions= | ||
Type=Application | ||
X-KDE-SubstituteUID=false | ||
X-KDE-Username=" > ~/Desktop/intellij-c.desktop | ||
else | ||
echo "Intellij Community is already installed" | ||
fi | ||
EOF | ||
} | ||
|
||
resource "coder_script" "intellij_c_uninstall" { | ||
count = var.desktop_setup && try(data.coder_parameter.intellij_c.0.value, false) ? 0 : 1 | ||
agent_id = coder_agent.devbox.id | ||
run_on_start = true | ||
display_name = "Intellij Community Uninstall" | ||
icon = "/icon/intellij.svg" | ||
script = <<-EOF | ||
#!/bin/bash | ||
set -e | ||
if [[ -d ~/apps/intellij-c ]]; then | ||
echo "Uninstall Intellij Community" | ||
rm -rf ~/apps/intellij-c | ||
rm -f ~/Desktop/intellij-c.desktop | ||
fi | ||
EOF | ||
} |
Oops, something went wrong.