forked from sudheer76R/java-example
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJenkinsfile-k8s
More file actions
33 lines (33 loc) · 917 Bytes
/
Jenkinsfile-k8s
File metadata and controls
33 lines (33 loc) · 917 Bytes
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
pipeline{
agent none
environment{
IMAGE_TAG = "${BUILD_NUMBER}"
}
stages{
stage('Git Checkout Stage'){
agent {label 'docker_node_new'}
steps{
git branch: 'main', url: 'https://github.com/fatimatabassum05/java-example.git'
}
}
stage('Build docker Image'){
agent {label 'docker_node_new'}
steps{
sh 'docker build -t fatimatabassum/fatima12:IMAGE_TAG .'
}
}
stage('Push To Dockerhub'){
agent {label 'docker_node_new'}
steps{
sh 'docker push fatimatabassum/fatima12:IMAGE_TAG'
}
}
stage('Deploy Stage') {
agent {label 'k8s_node'}
steps{
sh 'microk8s kubectl apply -f deploy.yml'
sh 'microk8s kubectl apply -f service.yml'
}
}
}
}