diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..ba12fd40c --- /dev/null +++ b/azure-pipelines.yml @@ -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.