-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
31 lines (28 loc) · 837 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
pipeline {
agent any
stages {
stage('Build') {
steps {
sh '''BUILD_ID=$(cat BUILD_ID)
docker login --username dm874andreas --password 0c55b68b-22df-433d-8f9b-097353b5c1f4
docker build -t dm874andreas/frontend-service:${BUILD_ID} -t dm874andreas/frontend-service:latest .
'''
}
}
stage('Push') {
steps {
sh '''BUILD_ID=$(cat BUILD_ID)
docker login --username dm874andreas --password 0c55b68b-22df-433d-8f9b-097353b5c1f4
docker push dm874andreas/frontend-service:latest
docker push dm874andreas/frontend-service:${BUILD_ID}'''
}
}
stage('Deploy') {
steps {
sh '''BUILD_ID=$(cat BUILD_ID)
sudo kubectl apply -f deployment.yaml
sudo kubectl set image deployment/frontend-service frontend-service=dm874andreas/frontend-service:${BUILD_ID}'''
}
}
}
}