Azure DevOps
Using Microsoft Hosted Agent
- Refer Here for the list of microsoft hosted agents
- Setting up Microsoft hosted agents (Watch the classroom video)
- Create a pipeline for game of life which use jdk 8
---
trigger:
- master
jobs:
- job: buildjob
displayName: Build and Package Game of life
pool:
vmImage: ubuntu-22.04
steps:
- task: Maven@3
inputs:
mavenPOMFile: 'pom.xml'
goals: 'package'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
- Azure DevOps Pipleine Variables Refer Here
- Azure DevOps has predefined varibales Refer Here
- Used Copyfiles task
---
trigger:
- master
jobs:
- job: buildjob
displayName: Build and Package Game of life
pool:
vmImage: ubuntu-22.04
steps:
- task: Maven@3
inputs:
mavenPOMFile: 'pom.xml'
goals: 'package'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
- task: CopyFiles@2
inputs:
Contents: "**/target/gameoflife.war"
TargetFolder: $(Build.ArtifactStagingDirectory)
- Lets use Publish build artifacts to acheive the same result Refer Here
---
trigger:
- master
jobs:
- job: buildjob
displayName: Build and Package Game of life
pool:
vmImage: ubuntu-22.04
steps:
- task: Maven@3
inputs:
mavenPOMFile: 'pom.xml'
goals: 'package'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
- task: CopyFiles@2
inputs:
Contents: "**/target/gameoflife.war"
TargetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: GameOfLifeArtifacts