forked from imcalled/LBG-Python-API
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
26 lines (26 loc) · 909 Bytes
/
Jenkinsfile
File metadata and controls
26 lines (26 loc) · 909 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
pipeline {
agent any
stages {
stage('Build') {
steps {
sh '''
docker build -t lbg7-20220905/lbg-api:latest -t imcalled/lbg-api:$BUILD_NUMBER .
docker push lbg7-20220905/lbg-api:latest
docker push lbg7-20220905/lbg-api:$BUILD_NUMBER
docker tag lbg7-20220905/lbg-api:latest gcr.io/lbg7-20220905/kun-lbg:v1
docker push lbg7-20220905/lbg-api:latest gcr.io/lbg7-20220905/kun-lbg:v1
'''
}
}
stage('Deploy') {
steps {
sh '''
ssh -i '~/.ssh/id_rsa' jenkins@35.242.152.138 << EOF
docker stop lbg-container
docker rm lbg-container
docker run -d -p 8080:8080 --name lbg-container lbg7-20220905/lbg-api:latest
'''
}
}
}
}