To integrate Torque with the CircleCI plugin, make sure to complete all four steps, as detailed in this article:
- Step 1: Enable CircleCI to Use 3rd Party Tools
- Step 2: Declare Torque in the CircleCI Config File
- Step 3: Define Required Environment Variables for Torque
- Step 4: Use Torque’s Tasks in Your CircleCI Workflow
Note that plugin only supports sandbox environments.
Step 1: Enable CircleCI to Use 3rd Party Tools
- On the Settings > Security page for your organization, enable use of 3rd-party orbs.
- If your project was added to CircleCI before version 2.1, on the Project Settings > Advanced Settings page, enable "pipelines" to use the orbs key.
Step 2: Declare Torque in the CircleCI Config File
- Add a single line to your version 2.1 .circleci/config.yaml file:
- Import the orbs key in your .circleci/yml/config.yml file.
- Add the orbs stanza below your version, invoking the orb:
Step 3: Define Required Environment Variables for Torque
- While logged in to CircleCI, in a separate browser window In Torque, open the Settings page and select Integrations.
- Under the CircleCI icon, select Connect.
- Copy the automatically generated token value and return to the CircleCI browser window.
- From your CircleCI dashboard, select Project Settings > Build Settings > Environment Variables.
- Add the following Environment Variables:
CS_COLONY_SERVER< = The URL for the CloudShell Torque Server (https://app.qtorque.io)
CS_COLONY_TOKEN = In CloudShell Torque, the automatically generated token from step 3
CS_COLONY_SPACE = Your CloudShell Torque Space name
Step 4: Use Torque's Tasks in Your CircleCI Workflow
- In the config.yml, declare the cloudshell-colony/start-sandbox and cloudshell-colony/end-sandbox commands to start and stop the sandbox in Torque. Review examples here.
- See the parameters list for orb behavior command customization here.
To learn more about how to work with the Torque Orb, check out this live code example on Github.