Skip to content

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

Merged
merged 4 commits into from
Aug 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
docs: add coder login to CI docs
  • Loading branch information
ericpaulsen committed Aug 11, 2023
commit 96b5b2ab8615e6fce65cd17a545273d021c98fbd
1 change: 1 addition & 0 deletions docs/templates/change-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

@matifali matifali Aug 11, 2023

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 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

Copy link
Member Author

@ericpaulsen ericpaulsen Aug 11, 2023

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

Copy link
Member

@matifali matifali Aug 12, 2023

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

coder templates push --yes $CODER_TEMPLATE_NAME \
--directory $CODER_TEMPLATE_DIR \
--name=$CODER_TEMPLATE_VERSION # Version name is optional
Expand Down