Environments walkthrough

Understand how to manage environments, switch between environments and promote tasks between environments.
In this guide, we'll create a task in a newly created development environment and then promote it to production. You may want to use a development environment to ensure a new task is working properly, or test changes to an existing task before releasing it to your team.

Create a development environment

Create a dev environment from the Environments page. You'll be able to choose the display name and slug for the environment (you can change these later). Let's choose Development for the display name and dev for the slug.
You can optionally choose a template to base the dev environment on. This will copy all tasks, runbooks, resources, configs and schedules to the newly created environment. Schedules will be paused by default.

Create a SQL task

Switch to the newly created dev environment by selecting Development in the top left dropdown menu.
Create a SQL task named Environments Demo. You can optionally add a description. Click continue to configure the SQL task.
We need to configure the resource that we want to run this new SQL task against. If you don't already have a Demo DB set up, you can click create a demo database under the Database resource configuration setting. Select the Demo DB resource once it's set up.
Let's add the following SQL query in the query configuration setting:
sql
Copied
1
SELECT company_name, total_dollars
2
FROM accounts
3
ORDER BY total_dollars DESC;
Execute the task in your dev environment and ensure the task runs properly. You should see rows of demo data.

Promote the task to production

Now that we've verified the task works properly in Development, it's time to promote the task to our prod environment. Click the triple dot dropdown for the Environments Demo SQL task from either the library or task edit page. From the dropdown, select Promote... and then select Production as the environment to promote to.
Finally, we need to promote the resource configuration to our Production environment so that the newly promoted SQL task can run against the Demo DB. Click the triple dot dropdown for the Demo DB resource via the settings page. From the dropdown, select Promote... and then select Production as the environment to promote to.
We're ready to run the task in the prod environment. Switch to the prod environment by selecting Production in the top left dropdown menu. Run the task in the prod environment and verify that it works correctly.

Additional details

While the examples here involved editing and promoting a task via the UI, you can also edit and promote tasks, runbooks and other entities via the CLI and Deployments. For more information, see Promoting between environments.