A run template is a named set of environment variables along with their values.
It can be used to quickly start a new pipeline with a specific environment, for example, to deploy a branch on a particular server (e.g., staging or production).
Defined run templates are accessible in the New Pipeline button’s dropdown on Pipelines List and Pull Request pages.
Run Templates settings are available on both Project & Repository levels and can be accessed by the following path:
- Project → Project Settings → SNAKE CI → Run Templates
- Repository → Repository Settings → SNAKE CI → Run Templates
New Run Template
Click on the Add Template button to add a new run template.
The name of template will be used in the New Pipeline button’s dropdown on Pipelines List and Pull Request pages. The description will be used as a tooltip of the specified Run Template.
After creating a run template you will see a page where you can specify Environment Variables for this specific Run Template. These environment variables will be passed to the runner when you run a new pipeline using specified Run Template.
On this page you can also edit, modify, and delete run templates and their environment variables.
Let’s define a few run templates for deploying to development, staging and production environments.
Define two run templates to deploy the project to the staging and the production environments on the Project level.
Define a run template to deploy to the development environment.
Navigate to the Pipelines List or the Pull Request page and click on the New Pipeline button, you can see both repository and project level run templates.
Pressing on an item from the list will pop up the dialog where you can adjust environment variables or even add a few new ones.
Press Run to start the specified Run Template and deploy the specified branch to the specified environment.