-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
30 lines (29 loc) · 1.14 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
pipeline {
agent any
tools {
maven 'apache-maven-3.5.4'
}
stages {
stage('Build') {
steps {
sh 'mvn package'
withDockerServer([credentialsId: "DockerMachine", uri: "tcp://192.168.99.100:2376" ]){
sh 'docker build -t jonasberlin/ci-demo:${BUILD_NUMBER} $WORKSPACE'
withDockerRegistry([credentialsId: "DockerHub", url: "https://docker.io/jonasberlin/ci-demo/"]){
sh 'docker push jonasberlin/ci-demo:${BUILD_NUMBER}'
}
}
}
post {
success {
junit 'target/surefire-reports/**/*.xml'
}
}
}
stage('Deploy'){
steps {
kubernetesDeploy configs: 'deploy.yaml', kubeconfigId: 'KubernetesConfig'
}
}
}
}