Azure release pipelines provide you with the first-class experience to integrate with Jenkins. You can have Jenkins as your Continuous Integration (CI) system and use Azure Devops Release for your Continuous Deployment (CD) and get all the benefits of Azure DevOps like:
- End to end traceability for your CI/CD workflow.
- Track you commits and work-items.
- Enable manual approvals and deployment gates on your pipeline.
- Deploy to various services (Azure) via Azure pipelines.
In this example you will build a Java web app using Jenkins and deploy to Azure Linux VM using DevOps Azure Pipelines.
Ensure the repo where your code is hosted (Github, GHE or Gitlab) is linked with your Jenkins project. Also, please ensure your JIRA server plugin is installed on Jenkins so that you can track your JIRA issues.
Now you can configure Jenkins with Azure DevOps to run your Continuous Deployment workflows.
- Install Team Foundation Server plugin on Jenkins.
- Now inside your Jenkins project, you will find a new post build action “Trigger release in TFS/Team Services”. Add the action into your project.
- Provide the collection url as – https://.visualstudio.com/DefaultCollection/
- Create a credential(username/password) for Azure Devops with PAT as password. Leave username as empty. Pass this credential to the action.
- Now you can select the Azure DevOps project and Release definition from the dropdowns. Choose the Release Definition you want to trigger upon completion on this Jenkins job.
Now a new release (CD) gets triggered every time your Jenkins CI job is completed.
However, to consume Jenkins job, you need to define Jenkins as artifact source in Azure DevOps.
- Go to your Azure DevOps project and create a new service connection for Jenkins.
- Now, go to your Release pipeline and add a new Jenkins artifact source and select the Jenkins job you want to consume as part of your pipeline.
- Every time you run your pipeline, artifacts from your Jenkins job are downloaded automatically and made available for you. Also, all the associated commits and JIRA issues are also extracted so that you can compare between release deployments and get the full traceability of your workflow.
That’s it and now you have a complete DevOps workflow with Jenkins as CI and Azure DevOps as CD and you can get full traceability of your workflow.
You can take advantage of Azure DevOps release features like approvals and deployment gates, integrate with Service Now and deploy to Azure, AWS or deploy to Linux VMs using Ansible and many more.
This post first appeared on MSDN Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The MSDN Blogs., please read the originial post: here