-
Notifications
You must be signed in to change notification settings - Fork 109
/
Jenkinsfile
26 lines (26 loc) · 977 Bytes
/
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
node {
stage('Prepare') {
echo 'Preparing...'
checkout scm
}
stage('Build') {
echo 'Building...'
sh './gradlew'
}
stage('Report') {
echo 'Reporting...'
junit '**/build/test-results/test/*.xml'
jacoco classPattern: '**/build/classes', exclusionPattern: '**/*Test*.class', execPattern: '**/build/jacoco/**.exec'
checkstyle canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/build/reports/checkstyle/*.xml', unHealthy: ''
pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '**/build/reports/pmd/*.xml', unHealthy: ''
}
stage('Docker') {
echo 'Building Docker Image...'
def IMAGE_NAME = 'leanstacks/skeleton-ws-spring-boot'
def image = docker.build("${IMAGE_NAME}:latest")
docker.withRegistry('', 'docker-hub-leanstacks') {
image.push()
}
sh "docker image rm ${IMAGE_NAME}:latest"
}
}