Search code examples
mavenazure-devopsazure-pipelinesreleasemaven-release-plugin

mvn release + azure pipeline - deploy


I'm using azure-pipelines.yml to build/deploy a java micro service. Maven is my build tool. My scenario:

I merged my changes to my main branch. My pom.xml version is 1.0.1-SNAPSHOT. I want to build my PROD release docker image, tagged with 1.0.1.

I run mvn release:prepare and it creates:

  • a git tag of the code, where the pom.xml version is 1.0.1 <--- This is the one I want to release
  • updates my pom.xml so version is now 1.0.2-SNAPSHOT

How do I trigger a build of the tagged release? There isn't a manual Set up build button in ADO for tags, only branches.


Solution

  • How do I trigger a build of the tagged release? There isn't a manual Set up build button in ADO for tags, only branches.

    You can run a pipeline based on a branch, tag or specific commit.

    When running a new pipeline click on the Branch/tag dropdown and then on Tags to select the desired tag:

    Run pipeline - select tag