mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor: conditionally use dotfiles in dogfood template (#5332)
* feat: add dotfiles_uri var to dogfood template * refactor: use dotfiles if dotfiles var exists This ensures the `coder dotfiles` command only runs if the dotfiles var in the template is not empty. * Update dogfood/main.tf * refactor: assign variable to shell variable * Update dogfood/main.tf * fixup!: add default value
This commit is contained in:
+17
-1
@@ -11,6 +11,19 @@ terraform {
|
||||
}
|
||||
}
|
||||
|
||||
# User parameters
|
||||
|
||||
variable "dotfiles_uri" {
|
||||
type = string
|
||||
description = <<-EOF
|
||||
default = ""
|
||||
Dotfiles repo URI (optional)
|
||||
|
||||
see https://dotfiles.github.io
|
||||
EOF
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "datocms_api_token" {
|
||||
type = string
|
||||
description = "An API token from DATOCMS for usage with building our website."
|
||||
@@ -39,7 +52,10 @@ resource "coder_agent" "dev" {
|
||||
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
|
||||
code-server --auth none --port 13337 &
|
||||
sudo service docker start
|
||||
coder dotfiles -y 2>&1 | tee ~/.personalize.log
|
||||
DOTFILES_URI=${var.dotfiles_uri}
|
||||
if [ -n "$DOTFILES_URI" ]; then
|
||||
coder dotfiles var.dotfiles_uri -y 2>&1 | tee ~/.personalize.log
|
||||
fi
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user