Merge pull request #1 from james-flynn-ie/azure-pipelines

Added: Build and Test Azure pipelines
This commit is contained in:
James Flynn 2021-02-28 12:40:36 +00:00 committed by GitHub
commit 3c1f095e41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

48
azure-pipelines.yml Normal file
View file

@ -0,0 +1,48 @@
# DEVELOPMENT OPERATIONS CONTINUOUS ASSESSMENT
pool:
# Using an Azure DevOps hosted agent. The advantages are:
# - The build VM is deployed by Microsoft, reducing maintenance.
# - Tools within the VM Image are always up to date.
# - Fresh build environment for every run (to reduce contamination from other runs).
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml
vmImage: ubuntu-20.04
# Adding extra information into build name, to make it easier to identify builds.
# It can be called using '$(Build.BuildNumber)'
name: $(Build.DefinitionName).$(SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r)
jobs:
- job: BuildTest
displayName: Build and Test Maven Project
steps:
- task: Maven@3
displayName: 'Maven Package'
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testRunTitle: '$(Build.BuildNumber)'
testResultsFiles: '**/TEST-*.xml'
goals: 'package'
- task: CopyFiles@2
displayName: 'Copy Files to artifact staging directory'
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: '**/target/*.?(war|jar)'
TargetFolder: $(Build.ArtifactStagingDirectory)
preserveTimestamp: true
# Publish build artifacts to Azure Pipelines. Extension uses Robocopy "under the hood."
# https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-build-artifacts?view=azure-devops
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)/target'
artifactName: 'jar-artifact'
publishLocation: 'Container' # Publishes inside Azure Pipelines artifact folder.
parallel: true # Increased speed through multi-threaded copying.
parallelCount: 8 # Dependent upon CPU capabilities.