-
Notifications
You must be signed in to change notification settings - Fork 62
/
Jenkinsfile
36 lines (30 loc) · 1.11 KB
/
Jenkinsfile
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
pipeline {
agent any
stages {
stage('Checkout Codebase'){
steps{
cleanWs()
checkout scm: [$class: 'GitSCM', branches: [[name: '*/main']],userRemoteConfigs:
[[credentialsId: 'github-ssh-key', url: '[email protected]:mnorm88/junit-automation.git']]]
}
}
stage('Build'){
steps{
sh 'mkdir lib'
sh 'cd lib/ ; wget https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/1.7.0/junit-platform-console-standalone-1.7.0-all.jar'
sh 'cd src ; javac -cp "../lib/junit-platform-console-standalone-1.7.0-all.jar" CarTest.java Car.java App.java'
}
}
stage('Test'){
steps{
sh 'cd src/ ; java -jar ../lib/junit-platform-console-standalone-1.7.0-all.jar -cp "." --select-class CarTest --reports-dir="reports"'
junit 'src/reports/*-jupiter.xml'
}
}
stage('Deploy'){
steps{
sh 'cd src/ ; java App'
}
}
}
}