Creating dedicated release pipeline

[skip ci]
This commit is contained in:
Mark Iantorno 2020-06-12 16:59:51 -04:00
parent 22ae8fa6dc
commit 9111ddc5d6
1 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,69 @@
trigger:
- release
pr: none
pool:
vmImage: "ubuntu-16.04"
variables:
VERSION:
steps:
# This task pulls the <version> 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)'