-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_backup
34 lines (26 loc) · 1.02 KB
/
Jenkinsfile_backup
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
node {
//def mvnHome = tool 'Maven3'
stage ('checkout') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: 'https://github.com/RahulKumar1119/springboot-petclinic-docker/']]])
}
//stage ('Build') {
// sh './mvnw package'
// }
stage ('Docker Build') {
// Build and push image with Jenkins' docker-plugin
withDockerRegistry([credentialsId: "dockerhub", url: "https://index.docker.io/v1/"]) {
image = docker.build("9870050478/springboot-petclinic", ".")
image.push()
}
}
stage ('Docker run') {
image.run("-p 8086:8080 --rm --name springboot-petclinic ")
}
stage ('K8S Deploy') {
kubernetesDeploy(
configs: 'k8s/spring-lb.yaml',
kubeconfigId: 'K8S',
enableConfigSubstitution: true
)
}
}