Update template
This commit is contained in:
@@ -39,8 +39,8 @@ coder templates create -d ./template --name vscode
|
|||||||
|
|
||||||
## 步驟 4:使用 VSCode + Copilot
|
## 步驟 4:使用 VSCode + Copilot
|
||||||
|
|
||||||
1. Workspace 啟動後 → 點擊 "code-server"
|
1. Workspace 啟動後 → 在 Dashboard 中應看到 "code" 應用
|
||||||
2. 進入 VSCode
|
2. 點擊 "code" 進入 VSCode
|
||||||
3. 左側 Extensions → 搜尋 "GitHub Copilot"
|
3. 左側 Extensions → 搜尋 "GitHub Copilot"
|
||||||
4. 安裝並授權
|
4. 安裝並授權
|
||||||
5. 開始寫代碼,Copilot 自動完成!
|
5. 開始寫代碼,Copilot 自動完成!
|
||||||
|
|||||||
@@ -124,6 +124,9 @@ module "code-server" {
|
|||||||
agent_id = coder_agent.main.id
|
agent_id = coder_agent.main.id
|
||||||
order = 1
|
order = 1
|
||||||
|
|
||||||
|
# 定義 subdomain,讓 Coder 可以在 Dashboard 顯示 code-server 按鈕
|
||||||
|
subdomain = "code"
|
||||||
|
|
||||||
# code-server 會自動使用:
|
# code-server 會自動使用:
|
||||||
# - 認證:繼承 Coder 的 OIDC (GitHub) 認證
|
# - 認證:繼承 Coder 的 OIDC (GitHub) 認證
|
||||||
# - 自動存檔:code-server 內建 auto-save
|
# - 自動存檔:code-server 內建 auto-save
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ coder templates create \
|
|||||||
|
|
||||||
4. **進入 VSCode**
|
4. **進入 VSCode**
|
||||||
```
|
```
|
||||||
Workspace 啟動後 → 點擊 "code-server"
|
Workspace 啟動後 → 在 Dashboard 中應看到 "code" 應用
|
||||||
→ 進入網頁版 VSCode
|
→ 點擊進入網頁版 VSCode
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
# 此文件定義 template 的可配置變數
|
|
||||||
# 使用者在建立 Workspace 時可以填入這些參數
|
|
||||||
|
|
||||||
variable "github_token" {
|
|
||||||
description = "GitHub Personal Access Token for GitHub Copilot authentication (optional, will auto-use OIDC if not provided)"
|
|
||||||
type = string
|
|
||||||
sensitive = true
|
|
||||||
default = ""
|
|
||||||
|
|
||||||
# 使用者提示
|
|
||||||
validation {
|
|
||||||
condition = length(var.github_token) == 0 || startswith(var.github_token, "ghp_")
|
|
||||||
error_message = "GitHub token should start with 'ghp_' or be empty."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# 未來可擴展的變數(示例,目前不需要):
|
|
||||||
# variable "extensions" {
|
|
||||||
# description = "VSCode extensions to auto-install"
|
|
||||||
# type = list(string)
|
|
||||||
# default = [
|
|
||||||
# "github.copilot",
|
|
||||||
# "ms-vscode.cpptools",
|
|
||||||
# "ms-python.python"
|
|
||||||
# ]
|
|
||||||
# }
|
|
||||||
Reference in New Issue
Block a user