Use the script below to create databases and a user for this demo.
-- Create Databases
CREATE DATABASE FLYWAY_DEMO COMMENT = 'Azure DevOps deployment test';
CREATE DATABASE FLYWAY_DEMO_DEV COMMENT = 'Azure DevOps deployment test';
CREATE DATABASE FLYWAY_DEMO_QA COMMENT = 'Azure DevOps deployment test';
-- Create a Deploy User
-- I'm granting sysadmin role to make it simple but you'd better to create a role with necessary permissions.
create user devopsuser password='<mypassword>' default_role = sysadmin;
Create your demo project - Snowflake_Flyway.
Step | Detail |
---|---|
Create a Project |
There are some manual tasks that you need to do to set up the demo environment using the resources from kulmam92/snowflake_flyway.
You need to have an environment to be able to add the Approval step. Let's create the necessary Environments and Approvals.
When you have a common set of variables that will be used in multiple pipelines, you create a variable group once and reference them in many groups.
Step | Detail |
---|---|
Create Variable Group | Snowflake.Database.env of the kulmam92/snowflake_flyway has the list of variables needed for this demo |
The repository with the same name as the project will be created by default. This will be our snowflake database project repository. I will create another repository to keep templates since it's a common module. Your team may have a repository for this purpose already.
Step | Detail |
---|---|
Create a Repo | Repository name: PipelineCommon |
Add Pipeline Template to PipelineCommon | Add Pipeline Template to PipelineCommon Copy all the files in the templates folder of the kulmam92/snowflake_flyway to your repo and push changes to PipelineCommon. Your repo will look like this after that. |
Step | Detail |
---|---|
Create a Pipeline | Click "Create Pipeline" |
Connect Tab | Choose "Azure Repos Git" |
Select Tab | Choose "Snowflake_flyway" |
Configure Tab | Choose "Starter pipeline" |
Review Tab | Paste the contents of templates\YAMLpipelines\azure-pipelines.yml file of the kulmam92/snowflake_flyway to the editor. Add the template repository resource at the beginning of the YAML script. This will let you reference templates in the PipelineCommon Repo. resources: Modify template reference. # For build Stage |
Save | Save |
Step | Detail |
---|---|
Clone Snowflake_flyway Repo | I will use the VS code. |
Copy migration scripts to your database Repo | Copy databases folder of the helper resource repository(kulmam92/snowflake_flyway) and paste to your database repo |
Commit and Push changes | |
Your changes will be in the Repo |
Your push to master will trigger the pipeline (Snowflake_Flyway) that you created.
This is the end of the Step-by-Step implementation guide. Now you have a working demo pipeline.