# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
name: Default
steps:
- task: Maven@3
inputs:
mavenPOMFile: 'pom.xml'
goals: 'package'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
testRunTitle: 'unittests'
Jenkins
node("JDK-11-MVN") {
stage("get-code") {
sh " git clone https://github.com/spring-projects/spring-petclinic.git && cd spring-petclinic"
}
stage("build") {
sh "mvn package"
junit '**/surefire-reports/TEST-*.xml'
}
}
The only manual work would be to go to jenkins and create a pipeline project and configure where your pipeline is
Pipeline as Code in Jenkins
Jenkins has two flavours
Scripted Pipeline
This was developed where you can execute groovy language directly
Declartive Pipeline
Jenkins has created a DSL (Domain specific Language) which is mostly inspired from traditional jenkins
Create a Scripted Pipeline
Create a game of life project
Pipeline can be written directly or can be chosen from source code management