Files
coder/docs/templates/change-management.md
T
Muhammad Atif AliandBen Potter 3cb9b3de24 docs: clarify how to set max token life in ci/cd docs (#6416)
* docs: clarify max token life in ci/cd docs

* Update docs/templates/change-management.md

---------

Co-authored-by: Ben Potter <me@bpmct.net>
2023-03-02 22:22:53 +00:00

1.2 KiB

Template Change Management

We recommend source controlling your templates as you would other code. Install Coder in CI/CD pipelines to push new template versions.

# Install the Coder CLI
curl -L https://coder.com/install.sh | sh
# curl -L https://coder.com/install.sh | sh -s -- --version=0.x

# To create API tokens, use `coder tokens create`.
# These variables are consumed by Coder
export CODER_URL=https://coder.example.com
export CODER_SESSION_TOKEN=*****

# Template details
export CODER_TEMPLATE_NAME=kubernetes
export CODER_TEMPLATE_DIR=.coder/templates/kubernetes
export CODER_TEMPLATE_VERSION=$(git rev-parse --short HEAD)

# Push the new template version to Coder
coder templates push --yes $CODER_TEMPLATE_NAME \
    --directory $CODER_TEMPLATE_DIR \
    --name=$CODER_TEMPLATE_VERSION # Version name is optional

Looking for an example? See how we push our development image and template via GitHub actions.

To create tokens with over a 30 day lifetime, configure Coder server to set a longer max token lifetime