forked from mdn/beginner-html-site-styled
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
43 lines (43 loc) · 1.2 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
39
40
41
42
43
pipeline {
agent none
environment {
DOCKERHUB_CREDENTIALS = credentials("dockerhub")
}
stages {
stage('git') {
agent {
label "kmaster"
}
steps {
script {
git'https://github.com/bvvinai/epgc_project.git'
}
}
}
stage('docker') {
agent {
label "kmaster"
}
steps {
script {
sh 'sudo docker build /home/ubuntu/jenkins/workspace/job/ -t bvvinai/proj'
sh 'sudo docker login -u ${DOCKERHUB_CREDENTIALS_USR} -p ${DOCKERHUB_CREDENTIALS_PSW}'
sh 'sudo docker push bvvinai/proj'
}
}
}
stage('kubernetes') {
agent {
label "kmaster"
}
steps {
script {
// sh 'kubectl delete deploy my-deployment'
sh 'kubectl apply -f deployment.yaml'
// sh 'kubectl delete service my-service'
sh 'kubectl apply -f service.yaml'
}
}
}
}
}