-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
52 lines (49 loc) · 1.54 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
44
45
46
47
48
49
50
51
52
def label = "jenkins-jnlp-slave"
podTemplate(label: label, cloud: 'kubernetes') {
node(label){
stage('Fetch') {
echo 'Fetching...'
git url: 'https://github.com/CodingYuanLiu/Jing.git', branch: 'develop'
}
stage('Build') {
echo 'Building...'
sh "go version"
sh """
cd code/backend/activity
go build main.go
docker build -t jing855/activity:latest .
"""
sh """
cd code/backend/api-gateway
go build main.go
docker build -t jing855/apigateway:latest .
"""
sh """
cd code/backend/login
go build login.go
docker build -t jing855/login:latest .
"""
sh """
cd code/backend/user
go build user.go
docker build -t jing855/user:latest .
"""
sh """
cd code/backend/feedback
go build main.go
docker build -t jing855/feedback:latest .
"""
}
stage('Push') {
echo 'Pushing...'
sh """
docker login -u jing855 -p summer855
docker push jing855/apigateway:latest
docker push jing855/login:latest
docker push jing855/user:latest
docker push jing855/activity:latest
docker push jing855/feedback:latest
"""
}
}
}