Skip to main content
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_dependencies which does the following:
    • Checks out the code.
    • Installs necessary packages.
    • Restores cache of ~/.terminus folder 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 ~/.terminus folder.
    • Authenticates Terminus.
    • Validates Terminus is logged in.
  • Defines a job build that uses the install_dependencies command.
  • Defines a workflow that executes the build job.
Information:
Note

Before you use this script:

  • Replace TOKEN in 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.