-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathJenkinsfile
More file actions
53 lines (46 loc) · 1.34 KB
/
Jenkinsfile
File metadata and controls
53 lines (46 loc) · 1.34 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
pipeline {
agent any
tools {
maven 'maven-3.9.4'
}
stages {
stage('Checkout') {
steps {
// Check out your source code from your version control system (e.g., Git)
checkout scm
}
}
stage('Unit Test') {
steps {
// Run unit tests (e.g., using Maven or Gradle)
sh 'mvn test'
}
}
stage('Publish Test Results') {
steps {
// Publish test results (e.g., for JUnit or TestNG)
junit 'target/surefire-reports/*.xml'
}
}
stage('Code Coverage') {
steps {
// Generate code coverage report (e.g., using JaCoCo)
sh 'mvn jacoco:report'
// Archive the report for later reference
archiveArtifacts 'target/site/jacoco/index.html'
}
}
stage('Build') {
steps {
// Build the source code (e.g., using Maven or Gradle)
sh 'mvn clean package'
}
}
stage('Publish Artifact') {
steps {
// Publish the artifact (e.g., a JAR file)
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
}
}
}
}