fix: download fleet and make version configurable
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b81e97116f
commit
5141952553
2 changed files with 20 additions and 9 deletions
|
@ -55,7 +55,7 @@ write_files:
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=${username}
|
User=${username}
|
||||||
ExecStart=/usr/local/bin/fleet launch workspace --version 1.19.111 -- --auth=accept-everyone --enableSmartMode --workspacePort 3500
|
ExecStart=/usr/local/bin/fleet launch workspace --version ${fleet_version} -- --auth=accept-everyone --enableSmartMode --workspacePort 3500
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
TimeoutStopSec=90
|
TimeoutStopSec=90
|
||||||
|
@ -111,6 +111,7 @@ runcmd:
|
||||||
- systemctl enable --now code-server@${username}
|
- systemctl enable --now code-server@${username}
|
||||||
%{ endif }
|
%{ endif }
|
||||||
%{ if remote_ide_setup == "fleet" ~}
|
%{ if remote_ide_setup == "fleet" ~}
|
||||||
|
- curl -LSs "https://download.jetbrains.com/product?code=FLL&release.type=preview&release.type=eap&platform=linux_x64" --output /usr/local/bin/fleet && chmod +x /usr/local/bin/fleet
|
||||||
- systemctl enable --now fleet
|
- systemctl enable --now fleet
|
||||||
%{ endif }
|
%{ endif }
|
||||||
- chown -R ${username}:${username} /home/${username}
|
- chown -R ${username}:${username} /home/${username}
|
|
@ -177,6 +177,15 @@ data "coder_parameter" "volume_size" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data "coder_parameter" "fleet_version" {
|
||||||
|
name = "fleet_version"
|
||||||
|
display_name = "Fleet version"
|
||||||
|
description = "Which version of Fleet should be installed?"
|
||||||
|
default = "1.19.111"
|
||||||
|
type = "string"
|
||||||
|
mutable = true
|
||||||
|
}
|
||||||
|
|
||||||
data "coder_parameter" "remote_ide" {
|
data "coder_parameter" "remote_ide" {
|
||||||
name = "install_remote_ide"
|
name = "install_remote_ide"
|
||||||
description = "Which remote IDE should be installed"
|
description = "Which remote IDE should be installed"
|
||||||
|
@ -247,7 +256,7 @@ resource "coder_app" "fleet" {
|
||||||
count = data.coder_parameter.remote_ide.value == "fleet" ? 1 : 0
|
count = data.coder_parameter.remote_ide.value == "fleet" ? 1 : 0
|
||||||
agent_id = coder_agent.dev.id
|
agent_id = coder_agent.dev.id
|
||||||
slug = "fleet"
|
slug = "fleet"
|
||||||
icon = "/icon/code.svg"
|
icon = "https://www.jetbrains.com/_assets/www/fleet/inc/overview-content/img/fleet-logo.65f4a04c59fc3ba93bb5e181050891c5.png"
|
||||||
url = "http://localhost:3500"
|
url = "http://localhost:3500"
|
||||||
subdomain = var.use_subdomain
|
subdomain = var.use_subdomain
|
||||||
}
|
}
|
||||||
|
@ -272,13 +281,14 @@ resource "hcloud_server" "root" {
|
||||||
ssh_keys = [hcloud_ssh_key.root.id]
|
ssh_keys = [hcloud_ssh_key.root.id]
|
||||||
|
|
||||||
user_data = templatefile("cloud-config.yaml.tftpl", {
|
user_data = templatefile("cloud-config.yaml.tftpl", {
|
||||||
username = data.coder_workspace.me.owner
|
username = data.coder_workspace.me.owner
|
||||||
volume_path = "/dev/disk/by-id/scsi-0HC_Volume_${hcloud_volume.root.id}"
|
volume_path = "/dev/disk/by-id/scsi-0HC_Volume_${hcloud_volume.root.id}"
|
||||||
init_script = base64encode(coder_agent.dev.init_script)
|
init_script = base64encode(coder_agent.dev.init_script)
|
||||||
coder_agent_token = coder_agent.dev.token
|
coder_agent_token = coder_agent.dev.token
|
||||||
remote_ide_setup = data.coder_parameter.remote_ide.value
|
remote_ide_setup = data.coder_parameter.remote_ide.value
|
||||||
install_podman_setup = data.coder_parameter.install_podman.value
|
fleet_version = data.coder_parameter.fleet_version.value
|
||||||
user_shell = data.coder_parameter.user_shell.value
|
install_podman_setup = data.coder_parameter.install_podman.value
|
||||||
|
user_shell = data.coder_parameter.user_shell.value
|
||||||
})
|
})
|
||||||
|
|
||||||
dynamic "network" {
|
dynamic "network" {
|
||||||
|
|
Loading…
Reference in a new issue