pin vscode-web version with commit-id
This commit is contained in:
@@ -69,3 +69,18 @@ module "vscode-web" {
|
|||||||
accept_license = true
|
accept_license = true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Pin a specific VS Code Web version
|
||||||
|
|
||||||
|
By default, this module installs the latest. To pin a specific version, retrieve the commit ID from the [VS Code Update API](https://update.code.visualstudio.com/api/commits/stable/server-linux-x64-web) and verify its corresponding release on the [VS Code GitHub Releases](https://github.com/microsoft/vscode/releases).
|
||||||
|
|
||||||
|
```tf
|
||||||
|
module "vscode-web" {
|
||||||
|
count = data.coder_workspace.me.start_count
|
||||||
|
source = "registry.coder.com/modules/vscode-web/coder"
|
||||||
|
version = "1.0.30"
|
||||||
|
agent_id = coder_agent.example.id
|
||||||
|
commit_id = "e54c774e0add60467559eb0d1e229c6452cf8447"
|
||||||
|
accept_license = true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ variable "install_prefix" {
|
|||||||
default = "/tmp/vscode-web"
|
default = "/tmp/vscode-web"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "vscode_web_commit_id" {
|
variable "commit_id" {
|
||||||
type = string
|
type = string
|
||||||
description = "Specify the commit ID of the VS Code Web binary to pin to a specific version. If left empty, the latest stable version is used."
|
description = "Specify the commit ID of the VS Code Web binary to pin to a specific version. If left empty, the latest stable version is used."
|
||||||
default = ""
|
default = ""
|
||||||
@@ -157,7 +157,7 @@ resource "coder_script" "vscode-web" {
|
|||||||
FOLDER : var.folder,
|
FOLDER : var.folder,
|
||||||
AUTO_INSTALL_EXTENSIONS : var.auto_install_extensions,
|
AUTO_INSTALL_EXTENSIONS : var.auto_install_extensions,
|
||||||
SERVER_BASE_PATH : local.server_base_path,
|
SERVER_BASE_PATH : local.server_base_path,
|
||||||
VSCODE_WEB_COMMIT_ID : var.vscode_web_commit_id,
|
COMMIT_ID : var.commit_id,
|
||||||
})
|
})
|
||||||
run_on_start = true
|
run_on_start = true
|
||||||
|
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ case "$ARCH" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
# Check if a specific VS Code Web commit ID was provided
|
# Check if a specific VS Code Web commit ID was provided
|
||||||
if [ -n "${VSCODE_WEB_COMMIT_ID}" ]; then
|
if [ -n "${COMMIT_ID}" ]; then
|
||||||
HASH="${VSCODE_WEB_COMMIT_ID}"
|
HASH="${COMMIT_ID}"
|
||||||
else
|
else
|
||||||
HASH=$(curl -fsSL https://update.code.visualstudio.com/api/commits/stable/server-linux-$ARCH-web | cut -d '"' -f 2)
|
HASH=$(curl -fsSL https://update.code.visualstudio.com/api/commits/stable/server-linux-$ARCH-web | cut -d '"' -f 2)
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user