2020-06-12 16:59:51 -04:00
|
|
|
trigger:
|
|
|
|
- release
|
|
|
|
|
|
|
|
pr: none
|
|
|
|
|
|
|
|
pool:
|
2021-10-08 13:24:33 -04:00
|
|
|
vmImage: "ubuntu-latest"
|
2020-06-12 16:59:51 -04:00
|
|
|
|
|
|
|
variables:
|
|
|
|
VERSION:
|
|
|
|
|
|
|
|
steps:
|
2020-07-07 09:53:40 -04:00
|
|
|
# Checks if the release notes file is populated. Exits if it is not.
|
|
|
|
- bash: |
|
|
|
|
if [ -s RELEASE_NOTES.md ]
|
|
|
|
then
|
|
|
|
echo "RELEASE_NOTES.md has data, proceeding to next step."
|
|
|
|
else
|
|
|
|
echo "Your RELEASE_NOTES.md file is empty. Please provide release notes before creating a release."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-06-12 16:59:51 -04:00
|
|
|
# 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'
|
2021-08-18 21:49:45 -04:00
|
|
|
jdkVersionOption: '1.11'
|
2020-06-12 16:59:51 -04:00
|
|
|
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)'
|