Skip to content

refactor: conditionally use dotfiles in dogfood template #5332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 13, 2022
18 changes: 17 additions & 1 deletion dogfood/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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
}

Expand Down