started coder-login

This commit is contained in:
Stephen Kirby
2023-09-29 15:36:19 +00:00
parent 5e805fef02
commit aac27055e6
3 changed files with 70 additions and 0 deletions

13
coder-login/run.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env sh
# Logs the coder user in
echo "Logging into Coder..."
# Automatically authenticate the user if they are not
# logged in to another deployment
if ! coder list >/dev/null 2>&1; then
set +x; coder login --token=$CODER_USER_TOKEN --url=$CODER_DEPLOYMENT_URL
else
echo "You are already authenticated with coder"
fi