-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJenkinsfile
38 lines (36 loc) · 1.18 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
37
38
//noinspection GroovyAssignabilityCheck
pipeline {
agent any
tools {
jdk 'jdk8'
maven 'maven'
}
stages {
stage('Build') {
steps {
// git branch: 'master', url: 'https://github.com/ovkhasch/petclinic-repo'
sh 'mvn clean package -DskipTests=true'
}
}
stage('Build docker images') {
steps {
script {
PETCLINIC_VERSION = sh (
script: 'xf=`ls target/*.jar` && echo $xf | awk \'{print substr($1,1,match($1,/.[^.]*$/)-1)}\' | awk \'{print substr($1,match($1,/[0-9]/))}\'',
returnStdout: true
).trim()
echo "Petclinic version: ${PETCLINIC_VERSION}"
docker.withRegistry('https://registry.kaiburr.com', 'chef01-registry') {
def petclinicImage = docker.build("petclinic:${PETCLINIC_VERSION}", '.')
petclinicImage.push()
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: 'target/*.jar'
}
}
}