From 5b454f9eff34cb6a0825a23bdd8db4a7a18990a8 Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Wed, 28 Jun 2023 04:16:04 +0000 Subject: [PATCH] Add Gitea Key --- default/main.tf | 10 ++++++++-- default/test.a | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 default/test.a diff --git a/default/main.tf b/default/main.tf index 64894b9..65e6ea4 100644 --- a/default/main.tf +++ b/default/main.tf @@ -40,6 +40,12 @@ variable "waka_api_key" { sensitive = true } +variable "gitea_key" { + description = "Access Key for Gitea" + type = string + sensitive = true +} + data "coder_parameter" "git_repo" { name = "git_repo" display_name= "Git Repo" @@ -91,9 +97,9 @@ resource "coder_agent" "main" { curl -fsSL https://gitea.nicholaspease.com/npease/CoderTemplatesV2/raw/branch/main/container-scripts/${data.coder_parameter.language.value}.sh | sh # WakaAPI Setup echo "[settings]" >> ~/.wakatime.cfg && echo "api_url = ${var.waka_api_url}" >> ~/.wakatime.cfg && echo "api_key = ${var.waka_api_key}" >> ~/.wakatime.cfg - # Clone Git Repo + # Clone Git Repo && Setup Auto Git Login + git config --global url."https://api:${var.gitea_key}@gitea.nicholaspease.com/".insteadOf "https://gitea.nicholaspease.com/" cd ~/ - if [ "${data.coder_parameter.git_repo.value}" != " " ] && [ ! -d "${data.coder_workspace.me.name}" ] then git clone ${data.coder_parameter.git_repo.value} diff --git a/default/test.a b/default/test.a deleted file mode 100644 index c9a139f..0000000 --- a/default/test.a +++ /dev/null @@ -1 +0,0 @@ -git config --global url."https://api:$MY_GIT_TOKEN@gitea.nicholaspease.com/".insteadOf "https://gitea.nicholaspease.com/" \ No newline at end of file