It is now possible to use GitHub Actions to automate sandbox lifecycle management. We currently provide the following workflows, which can be added as new custom workflows or as additions to existing ones:
- torque-start-sb-action: Starts a sandbox
- torque-end-sb-action: Ends a sandbox
- torque-validate-bp-action: Validates the syntax of specific application/service/blueprint YAMLs.
To use workflows, make sure to set a Torque authentication token in the GitHub repo. You can easily generate a token using any of Torque’s built-in CI/CD tools. For illustration purposes, we’ll use Jenkins:
- In Torque, go to Settings>Integrations>Jenkins>Connect>New Token.
- Copy the token and store it somewhere you’ll remember.
- In the GitHub repo, go to Settings>Secrets>new repository secret and set the token. Make sure the name of the token matches the token name in the workflow - “TORQUE_TOKEN” in our case:
- Next, add the desired workflow(s) as GitHub Actions:
- Open the appropriate Torque workflow’s README file and copy the example YAML code block.
- Open the desired GitHub repository.
- Click the Actions menu and add a new workflow or edit an existing one.
- In the workflow yaml, paste the workflow code block.
- Update the information in the code block according to the README’s Usage section.
“start sandbox” and “end sandbox” workflows defined to run when a pull request is created on the master branch:
“validate blueprint” workflow defined to run when a pull request is either created or pushed:
on: [push, pull_request]