forked from spring-projects/spring-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
43 lines (34 loc) · 867 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pipeline{
agent any
tools{
maven 'Maven3..9.5'
}
stages{
stage('CheckOutCode'){
steps{
git credentialsId: 'github_credential', url: 'https://github.com/Amargunge/spring-petclinic.git'
}
}
stage('Build'){
steps{
sh "mvn clean package"
}
}
stage('Build Docker Image'){
steps{
sh 'docker build -t Amargunge/spring-petclinic .'
}
}
stage('Push Docker Image'){
withCredentials([string(credentialsId: 'DOKCER_HUB_PASSWORD', variable: 'DOKCER_HUB_PASSWORD')]) {
sh "docker login -u Amargunge -p ${DOKCER_HUB_PASSWORD}"
}
sh 'docker push Amargunge/spring-petclinic'
}
stage("Deploy To Kuberates Cluster"){
kubernetesDeploy(
configs: 'Kubernete Manifast.yml',
kubeconfigId: 'KUBERNATES_CONFIG',
enableConfigSubstitution: true
)
}