This section explains how to set up an Azure DevOps pipeline that leverages a self-hosted agent to execute Liquibase operations through Liquibase Flow files.
An Azure DevOps self-hosted agent can be shared among multiple projects, so one agent can serve several teams. You can learn more about Azure Pipelines agents by visiting the Microsoft Azure documentation website.
Watch the video for an overview of using Azure DevOps with Liquibase.
An integration with Azure DevOps requires the following:
An Azure DevOps Project in your organization and membership in the Project Administrators group or the Build Administrators group.
Liquibase Pro is installed on a self-hosted Azure DevOps agent. The network must be configured from this runner to allow connections to the databases you wish to manage. You can learn more about Azure Pipeline agents in the Azure DevOps documentation.
This sample uses a GitHub repository, but you can use an Azure Repo if you prefer.
For additional information on setting up Azure Pipelines, visit the Azure Pipelines documentation website.
Each of the four pipelines below must be created and given permissions individually:
Continuous Deployment - azure_liquibase_pro_cd_action.yml
Continuous Integration - azure_liquibase_pro_ci_action.yml
Manual Deployment - azure_liquibase_pro_manual_deployment.yml
Rollback Utility - azure_liquibase_pro_rollback_utility_workflow.yml
Create a new pipeline for each of the above definitions using the following steps:
Go to the Azure DevOps project and select Pipelines->Pipelines.
Click New Pipeline.
In the Where is your code panel, select GitHub.
In the Select a Repository panel, select the GitHub repository from the Repository Setup step above. To see the repo, you might need to change the My Repositories dropdown to All Repositories.
In the Configure your pipeline panel, select Existing Azure Pipelines YAML file.
Select an existing YAML file panel, select the develop branch, then select the pipeline definition and select Continue.
In the Review your pipeline YAML panel, select the pulldown under Run and select Save. The pipeline will be created.
Set up your environments in GitHub using the instructions from the Secure Setup Using Azure Key Vault page in this guide.
The example uses DEV, QA, AND PROD environments.
To execute the CI pipeline, commit a change to the changelog in the develop branch in your repository.
Go to Azure Pipelines and observe the Continuous Integration pipeline.
Grant the permissions needed to allow the pipelines to run initially.
Select View when you see the message, then select Permit:
5. Select View when you see the above message, then select Permit for each permission prompt: