-
Notifications
You must be signed in to change notification settings - Fork 887
docs: add coder login to CI docs #9038
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
Conversation
docs/templates/change-management.md
Outdated
@@ -20,6 +20,7 @@ export CODER_TEMPLATE_DIR=.coder/templates/kubernetes | |||
export CODER_TEMPLATE_VERSION=$(git rev-parse --short HEAD) | |||
|
|||
# Push the new template version to Coder | |||
coder login <access-url> --token $CODER_SESSION_TOKEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or they can set $CODER_URL
as a sceret/environment variable in CI. Then they do not need <access-url>
Also we do not need to login if we have $CODER_SESSION_TOKEN
and $CODER_URL
available as environment varibales
See how we do this for dogfood,
coder/.github/workflows/dogfood.yaml
Line 77 in 40f3fc3
./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message="$CODER_TEMPLATE_MESSAGE" |
also in update-coder-template github action,
https://github.com/matifali/update-coder-template/blob/main/push_template.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matifali this is not working for me:
➜ coder templates create auth-test
running command "coder templates push": You are not logged in. Try logging in using 'coder login <url>'.:
github.com/coder/coder/cli.init
/home/runner/actions-runner/_work/coder/coder/cli/root.go:74
✗ echo $CODER_SESSION_TOKEN
KbqY3sl...hGS8lPj
➜ echo $CODER_URL
eric.oss.demo.coder.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you setting the variables. You need to use
export CODER_SESSION_TOKEN=KbqY3sl...hGS8lPj
export CODER_URL=eric.oss.demo.coder.com
coder templates create auth-test
@ericpaulsen we don't need to login because we already have the |
@matifali this worked for me:
although our docs do not include the |
@ericpaulsen they are mot required. Coder cli can automatically read these environment variables. 1st approach coder templates create auth-test given 2nd approach coder templates create auth-test --token some-token --url dev.coder.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could also pass the --url for each coder command along with --token
a customer asked how to non-interactively authenticate the
coder templates push
command we have in our CI documentation. this PR documents this step by adding thecoder login <url> --token $CODER_SESSION_TOKEN
command.