forked from vcjain/docker-agent-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile-dockerfile
33 lines (32 loc) · 1.15 KB
/
Jenkinsfile-dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pipeline {
agent {
dockerfile {
dir '.'
filename 'Dockerfile'
label 'ssh'
args '-v /var/run/docker.sock:/var/run/docker.sock -u root'
}
}
stages{
stage('checkout'){
steps{
checkout poll: false, scm: scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/vcjain/docker-agent-demo.git']])
}
}
stage('Build'){
steps{
echo 'Building Maven project'
sh 'mvn install'
archiveArtifacts artifacts: 'target/calculator-0.0.1-SNAPSHOT.jar', followSymlinks: false
}
}
stage('Test'){
steps{
echo 'Building Maven project'
sh 'mvn test'
junit '**/target/surefire-reports/*.xml'
jacoco classPattern: '**/target/classes', exclusionPattern: '**/*Test*.class', execPattern: '**/target/jacoco.exec', inclusionPattern: '**/*.class', sourceExclusionPattern: 'generated/**/*.java', sourceInclusionPattern: '**/*.java'
}
}
}
}