From 9111ddc5d655469ef92768f13f22e79e702950c4 Mon Sep 17 00:00:00 2001 From: Mark Iantorno Date: Fri, 12 Jun 2020 16:59:51 -0400 Subject: [PATCH] Creating dedicated release pipeline [skip ci] --- release-branch-pipeline.yml | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 release-branch-pipeline.yml diff --git a/release-branch-pipeline.yml b/release-branch-pipeline.yml new file mode 100644 index 000000000..9c23cec84 --- /dev/null +++ b/release-branch-pipeline.yml @@ -0,0 +1,69 @@ +trigger: +- release + +pr: none + +pool: + vmImage: "ubuntu-16.04" + +variables: + VERSION: + +steps: + # This task pulls the value from the org.hl7.fhir.r5 project pom.xml file. All modules are released as + # the same version, at the same time, as defined in the root level pom.xml. + - task: PowerShell@2 + inputs: + targetType: 'inline' + script: | + [xml]$pomXml = Get-Content -Path .\pom.xml + # version + Write-Host $pomXml.project.version + $version=$pomXml.project.version + Write-Host "##vso[task.setvariable variable=version]$version" + + # Prints out the build version, for debugging purposes + - bash: echo Pulled version from pom.xml => $(version) + + # Azure pipelines cannot pass variables between pipelines, but it can pass files, so we + # pass the build id (ex: 1.1.13-SNAPSHOT) as a string in a file. + # This is used in the release pipeline, so we create it here. + - bash: | + echo $(version) + VERSION=$(version) + echo "$VERSION" > $(System.DefaultWorkingDirectory)/VERSION + + # Copies the VERSION file containing the build id (ex: 1.1.13-SNAPSHOT) to the staging directory + # This is done for release versions only. + - task: CopyFiles@2 + displayName: 'Copy Files to: $(build.artifactstagingdirectory)' + inputs: + SourceFolder: '$(System.Defaultworkingdirectory)' + Contents: "$(System.DefaultWorkingDirectory)/VERSION" + TargetFolder: '$(build.artifactstagingdirectory)' + + # Runs 'mvn clean package' + - task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx3072m' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.8' + jdkArchitectureOption: 'x64' + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' + goals: 'package' + + # Publishes the built Validator jar to build artifacts. Primarily for testing and debugging builds. + - task: PublishPipelineArtifact@1 + displayName: 'Publish Validator jar' + inputs: + targetPath: "$(System.DefaultWorkingDirectory)/org.hl7.fhir.validation/target/org.hl7.fhir.validation-$(version).jar" + artifactName: Validator + + # Publishes the files we've moved into the staging directory, so they can be accessed by the + # release pipeline. + - task: PublishBuildArtifacts@1 + displayName: 'Publish Build Artifacts' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)'