trying to bypass coder params

pull/47/head
Stephen Kirby 2 years ago
parent 7bef2d9842
commit 4f93513e27

@ -17,7 +17,7 @@ variable "agent_id" {
variable "allow_username_change" {
type = bool
description = "Allow developers to change their git username."
default = true
default = false
}
variable "allow_email_change" {
@ -26,15 +26,15 @@ variable "allow_email_change" {
default = false
}
variable "default_username_source" {
type = string
description = "Default source to use for git-config user.name."
}
# variable "default_username_source" {
# type = string
# description = "Default source to use for git-config user.name."
# }
variable "default_email_source" {
type = string
description = "Default source to use for git-config user.email."
}
# variable "default_email_source" {
# type = string
# description = "Default source to use for git-config user.email."
# }
# data "coder_workspace" "me" {}
@ -61,8 +61,8 @@ data "coder_parameter" "username" {
resource "coder_script" "git_config" {
agent_id = var.agent_id
script = templatefile("${path.module}/run.sh", {
GIT_USERNAME = try(data.coder_parameter.username[0].value, var.default_username_source)
GIT_EMAIL = try(data.coder_parameter.user_email[0].value, var.default_email_source)
GIT_USERNAME = data.coder_workspace.me.owner # try(data.coder_parameter.username[0].value, var.default_username_source)
GIT_EMAIL = data.coder_workspace.me.owner_email # try(data.coder_parameter.user_email[0].value, var.default_email_source)
})
display_name = "Git Config"
icon = "/icon/git.svg"
@ -70,6 +70,10 @@ resource "coder_script" "git_config" {
}
# last implementation
# GIT_USERNAME = try(data.coder_parameter.username[0].value, var.default_username_source)
# GIT_EMAIL = try(data.coder_parameter.user_email[0].value, var.default_email_source)
# Old implementation, saving for testing
# GIT_USERNAME = try(data.coder_parameter.username[0].value, data.coder_workspace.git_config.owner)
# GIT_EMAIL = try(data.coder_parameter.user_email[0].value, data.coder_workspace.git_config.owner_email)
Loading…
Cancel
Save