ready for testing
This commit is contained in:
@@ -24,15 +24,14 @@ variable "coder_deployment_url" {
|
|||||||
description = "Coder Deployment URL,"
|
description = "Coder Deployment URL,"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "coder_script" "coder-login" {
|
||||||
resource "coder_script" "personalize" {
|
|
||||||
agent_id = var.agent_id
|
agent_id = var.agent_id
|
||||||
script = templatefile("${path.module}/run.sh", {
|
script = templatefile("${path.module}/run.sh", {
|
||||||
CODER_USER_TOKEN : var.coder_user_token,
|
CODER_USER_TOKEN : var.coder_user_token,
|
||||||
CODER_DEPLOYMENT_URL : var.coder_deployment_url
|
CODER_DEPLOYMENT_URL : var.coder_deployment_url
|
||||||
})
|
})
|
||||||
display_name = "Personalize"
|
display_name = "Personalize"
|
||||||
icon = "/icon/personalize.svg"
|
icon = "/emojis/1f511.png"
|
||||||
log_path = var.log_path
|
log_path = var.log_path
|
||||||
run_on_start = true
|
run_on_start = true
|
||||||
start_blocks_login = true
|
start_blocks_login = true
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
# Logs the coder user in
|
|
||||||
|
|
||||||
echo "Logging into Coder..."
|
|
||||||
|
|
||||||
# Automatically authenticate the user if they are not
|
# Automatically authenticate the user if they are not
|
||||||
# logged in to another deployment
|
# logged in to another deployment
|
||||||
|
|
||||||
|
echo "Logging into Coder..."
|
||||||
|
|
||||||
if ! coder list >/dev/null 2>&1; then
|
if ! coder list >/dev/null 2>&1; then
|
||||||
set +x; coder login --token=$CODER_USER_TOKEN --url=$CODER_DEPLOYMENT_URL
|
set +x; coder login --token=$CODER_USER_TOKEN --url=$CODER_DEPLOYMENT_URL
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user