mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 07:45:49 +00:00
Merge pull request #1 from james-flynn-ie/azure-pipelines
Added: Build and Test Azure pipelines
This commit is contained in:
commit
3c1f095e41
1 changed files with 48 additions and 0 deletions
48
azure-pipelines.yml
Normal file
48
azure-pipelines.yml
Normal 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.
|
Loading…
Reference in a new issue