Last Reviewed: 2023-06-08
Authenticate Terminus in a CircleCI Pipeline
Learn how to authenticate Terminus in a CircleCI pipeline without errors.
This section provides information on how to authenticate Terminus in a CircleCI pipeline without receiving errors and avoiding authentication rate limits.
Caching Authentication for CircleCI Pipelines
You can use the example script in this section for a full start-to-finish Terminus authentication in CircleCI. This pipeline does the following:
- Defines an executor with an Ubuntu environment, which installs PHP.
- Defines a command
install_dependencieswhich does the following:- Checks out the code.
- Installs necessary packages.
- Restores cache of
~/.terminusfolder if it exists. - Fetches the latest version of Terminus from the GitHub API.
- Installs Terminus and adds its path to the environment variable
$PATH. - Saves the cache for the
~/.terminusfolder. - Authenticates Terminus.
- Validates Terminus is logged in.
- Defines a job
buildthat uses theinstall_dependenciescommand. - Defines a workflow that executes the
buildjob.
Information:
Note
Before you use this script:
- Replace
TOKENin the script below with the machine token provided by Terminus. - Add the machine token provided by Terminus to your environment variables in the CircleCI project settings.