Skip to content

Commit 31ee357

Browse files
committed
address PR comments
1 parent e3ab855 commit 31ee357

File tree

4 files changed

+53
-85
lines changed

4 files changed

+53
-85
lines changed

.github/workflows/dogfood.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ jobs:
196196
CODER_URL: https://dev.coder.com
197197
CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }}
198198
# Template source & details
199+
TF_VAR_CODER_TEMPLATE_NAME: "${{ secrets.CODER_TEMPLATE_NAME }}-envbuilder"
199200
TF_VAR_CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
200-
TF_VAR_CODER_TEMPLATE_DIR: ./contents
201201
TF_VAR_CODER_TEMPLATE_MESSAGE: ${{ steps.message.outputs.pr_title }}
202202
TF_LOG: info

dogfood/coder-envbuilder/contents/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ data "coder_parameter" "devcontainer_repo" {
4343
data "coder_parameter" "devcontainer_dir" {
4444
type = "string"
4545
name = "Devcontainer Directory"
46-
default = "dogfood/contents/"
46+
default = "dogfood/coder/contents/"
4747
description = "Directory containing a devcontainer.json relative to the repository root"
4848
mutable = true
4949
}

dogfood/coder-envbuilder/main.tf

Lines changed: 0 additions & 79 deletions
This file was deleted.

dogfood/coder/main.tf renamed to dogfood/main.tf

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ terraform {
44
source = "coder/coderd"
55
}
66
}
7-
backend "gcs" {
8-
bucket = "coder-dogfood-tf-state"
9-
}
7+
# backend "gcs" {
8+
# bucket = "coder-dogfood-tf-state"
9+
# }
1010
}
1111

1212
data "coderd_organization" "default" {
@@ -43,8 +43,55 @@ resource "coderd_template" "dogfood" {
4343
{
4444
name = var.CODER_TEMPLATE_VERSION
4545
message = var.CODER_TEMPLATE_MESSAGE
46-
directory = var.CODER_TEMPLATE_DIR
46+
directory = "./coder/contents"
47+
active = true
48+
}
49+
]
50+
acl = {
51+
groups = [{
52+
id = data.coderd_organization.default.id
53+
role = "use"
54+
}]
55+
users = [{
56+
id = data.coderd_user.machine.id
57+
role = "admin"
58+
}]
59+
}
60+
activity_bump_ms = 10800000
61+
allow_user_auto_start = true
62+
allow_user_auto_stop = true
63+
allow_user_cancel_workspace_jobs = false
64+
auto_start_permitted_days_of_week = ["friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday"]
65+
auto_stop_requirement = {
66+
days_of_week = ["sunday"]
67+
weeks = 1
68+
}
69+
default_ttl_ms = 28800000
70+
deprecation_message = null
71+
failure_ttl_ms = 604800000
72+
require_active_version = true
73+
time_til_dormant_autodelete_ms = 7776000000
74+
time_til_dormant_ms = 8640000000
75+
}
76+
77+
78+
resource "coderd_template" "envbuilder_dogfood" {
79+
name = "coder-envbuilder"
80+
display_name = "Write Coder on Coder using Envbuilder"
81+
description = "Write Coder on Coder using a workspace built by Envbuilder."
82+
icon = "/emojis/1f3d7.png" # 🏗️
83+
organization_id = "703f72a1-76f6-4f89-9de6-8a3989693fe5"
84+
versions = [
85+
{
86+
name = var.CODER_TEMPLATE_VERSION
87+
message = var.CODER_TEMPLATE_MESSAGE
88+
directory = "./coder-envbuilder/contents"
4789
active = true
90+
tf_vars = [{
91+
# clusters/dogfood-v2/coder/provisioner/configs/values.yaml#L191-L194
92+
name = "envbuilder_cache_dockerconfigjson_path"
93+
value = "/home/coder/envbuilder-cache-dockerconfig.json"
94+
}]
4895
}
4996
]
5097
acl = {

0 commit comments

Comments
 (0)