Azure DevOps Pipeline

DevOps has evolved today to include Continuous integration and continuous delivery (CI/CD), along with programmable infrastructure and services that support automating the entire lifecycle of an application.

In this article, I provide a simple example to understand how to use Azure DevOps Services to build, test and deploy a Java based application inside a Docker container. The steps provided in this blog article should help you understand the sequence of building a fully automated build and release pipeline for a sample Java application that is designed to be built using Maven.

Pre-requisites:

  • You should know how to create a git repo
  • You should be aware how maven works to be able to troubleshoot the build itself
  • You should be aware of YAML syntax
  • You should have a local copy of a sample Java console application along with the POM file, structured as a Maven project.

Steps:

  1. Sign in to GitHub.
  2. Create a Repository.
  3. Using the command line, push your java project to the github repository.
  4. Sign in to Azure DevOps at dev.azure.com and create a new organization.
  5. Create a new Project in this organization.
  6. Click on the Project.
  7. Navigate to the Repos -> Files Option and select ‘Import’.
  8. Provide the URL to the github repo you created in step 2.
  9. Verify that the code is properly pulled into the Azure git repo for this project.
  10. Clone this repo onto your development machine.
  11. Add the azure-pipeline-1.yml file to the project containing the build sequence that should get executed on Azure DevOps.
  12. Add the Dockerfile that will be used to create the docker container for hosting the java application.
  13. Commit the artifacts to the Azure DevOps git repo.
  14. From the Pipelines menu in Azure DevOps, add a new pipeline pointing to the file you created in step 11.
  15. Observe how the pipeline runs and verify the output from the log.

 

Scroll to top
shares