Automation (Templates)
Define and share common Tasks with your team.
Introduction
Templates are pre-defined Tasks stored in a Git repository. These
special Tasks have variables defined in their scripts.
When creating a Task using a Template, you have to provide only the
variables. A regular Task will be created using the Template script
filled with the parameters you provide.
You can run a Task from Slack providing the parameters to the Runops
bot, get reviews, and get result logs; all without touching a single
line of code or command-line. But you can also use the Runops CLI.
Create a Template
Let’s create a Template for querying DynamoDB.
We will create a Template using Python with AWS’s boto3 library.
After creating the script, we commit it to the
main
branch
of the Runops Templates repository.:::tip pro-tip Open the Templates repository for everyone at your
company to contribute with scripts they already have. :::
Here is our template, lets save it to a file and commit it to the
main
branch of a Github repository.pythonselect * from customers where id in ( {{ids}} )
This template has 1 parameters which is indicated by double curly
braces:
{{ids}}
- the list of ids to selectConnect Runops to Github
Head over to settings inside the Runops web portal and install the
Github app.
Check available templates
Check the Templates tab inside the portal. Or type
/runops templates
anywhere in Slack.Use a Template
Create a Task from the Template. Select the template in the list,
provide the inputs, and run it.