Update azure-pipelines with new OS images and restricted version publishing.

This commit is contained in:
Mark Iantorno 2020-06-04 14:06:58 -04:00
parent 74c8ba0580
commit 156fc08e10
1 changed files with 14 additions and 14 deletions

View File

@ -10,11 +10,11 @@ pr:
strategy: strategy:
matrix: matrix:
linux: linux:
imageName: "ubuntu-16.04" imageName: 'ubuntu-latest'
# mac: mac:
# imageName: "macos-10.14" imageName: "macos-10.15"
# windows: windows:
# imageName: "vs2017-win2016" imageName: "wondows-2019"
maxParallel: 3 maxParallel: 3
pool: pool:
@ -26,11 +26,10 @@ variables:
VERSION: VERSION:
steps: steps:
- bash: ls -la
- bash: pwd
# This task pulls the <version> value from the org.hl7.fhir.r5 project pom.xml file. All modules are released as # 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. # the same version, at the same time, as defined in the root level pom.xml.
- task: PowerShell@2 - task: PowerShell@2
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
@ -42,6 +41,7 @@ steps:
# Prints out the build version, for debugging purposes # Prints out the build version, for debugging purposes
- bash: echo Pulled version from pom.xml => $(version) - bash: echo Pulled version from pom.xml => $(version)
condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
# Azure pipelines cannot pass variables between pipelines, but it can pass files, so we # 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. # pass the build id (ex: 1.1.13-SNAPSHOT) as a string in a file.
@ -51,12 +51,12 @@ steps:
echo $(version) echo $(version)
VERSION=$(version) VERSION=$(version)
echo "$VERSION" > $(System.DefaultWorkingDirectory)/VERSION echo "$VERSION" > $(System.DefaultWorkingDirectory)/VERSION
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release')) condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
# Copies the VERSION file containing the build id (ex: 1.1.13-SNAPSHOT) to the staging directory # Copies the VERSION file containing the build id (ex: 1.1.13-SNAPSHOT) to the staging directory
# This is done for release versions only. # This is done for release versions only.
- task: CopyFiles@2 - task: CopyFiles@2
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release')) condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
displayName: 'Copy Files to: $(build.artifactstagingdirectory)' displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs: inputs:
SourceFolder: '$(System.Defaultworkingdirectory)' SourceFolder: '$(System.Defaultworkingdirectory)'
@ -73,12 +73,12 @@ steps:
jdkArchitectureOption: 'x64' jdkArchitectureOption: 'x64'
publishJUnitResults: true publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml' testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'clean package' goals: 'package'
# Upload test results to codecov # Upload test results to codecov
- script: bash <(curl https://codecov.io/bash) -t $(codecov) - script: bash <(curl https://codecov.io/bash) -t $(codecov)
displayName: 'codecov Bash Uploader' displayName: 'codecov Bash Uploader'
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# Publishes the test results to build artifacts. # Publishes the test results to build artifacts.
- task: PublishCodeCoverageResults@1 - task: PublishCodeCoverageResults@1
@ -87,12 +87,12 @@ steps:
codeCoverageTool: 'JaCoCo' codeCoverageTool: 'JaCoCo'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/jacoco.xml' summaryFileLocation: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/jacoco.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/' reportDirectory: '$(System.DefaultWorkingDirectory)/org.hl7.fhir.report/target/site/jacoco-aggregate/'
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/master')) condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# Publishes the built Validator jar to build artifacts. Primarily for testing and debugging builds. # Publishes the built Validator jar to build artifacts. Primarily for testing and debugging builds.
- task: PublishPipelineArtifact@1 - task: PublishPipelineArtifact@1
displayName: 'Publish Validator jar' displayName: 'Publish Validator jar'
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release')) condition: and(eq(variables.currentImage, 'ubuntu-latest), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
inputs: inputs:
targetPath: "$(System.DefaultWorkingDirectory)/org.hl7.fhir.validation/target/org.hl7.fhir.validation-$(version).jar" targetPath: "$(System.DefaultWorkingDirectory)/org.hl7.fhir.validation/target/org.hl7.fhir.validation-$(version).jar"
artifactName: Validator artifactName: Validator
@ -102,7 +102,7 @@ steps:
# for each of the three release pipelines will cause conflicts. # for each of the three release pipelines will cause conflicts.
# This is done for release versions only. # This is done for release versions only.
- task: PublishBuildArtifacts@1 - task: PublishBuildArtifacts@1
condition: and(eq(variables.currentImage, 'ubuntu-16.04'), eq(variables['Build.SourceBranch'], 'refs/heads/release')) condition: and(eq(variables.currentImage, 'ubuntu-latest'), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
displayName: 'Publish Build Artifacts' displayName: 'Publish Build Artifacts'
inputs: inputs:
PathtoPublish: '$(build.artifactstagingdirectory)' PathtoPublish: '$(build.artifactstagingdirectory)'