Repository showcasing usage of CircleCI's new context CLI functionality.
- Need to have the following env variables set, either project-level or context-level:
Variable | Description |
---|---|
VCS |
Either "github" or "bitbucket" |
CIRCLECI_CLI_TOKEN |
A personal API token for CircleCI. User must have org-level/admin permissions |
- We use the CircleCI CLI Orb to install the client-side CLI and setup auth with the
CIRCLECI_CLI_TOKEN
variable.
orbs:
circleci-cli: circleci/[email protected]
# ...
jobs:
context-cli-test:
# ...
steps:
- circleci-cli/install
- circleci-cli/setup
- Then we demonstrate the Context CLI functionality in multiple steps. The commands generally follow this format:
circleci context FUNCTION $VCS $CIRCLE_PROJECT_USERNAME [FUNCTION-SPECIFIC_ARGS...]
The current functions available include create/delete of context, and create/delete of variables inside the context. $VCS
you should have set as a prerequisite, and $CIRCLE_PROJECT_USERNAME
refers to the org name owning the current project.
Run circleci context
or circleci context -h
for more help and information on available commands.