-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
51 lines (49 loc) · 1.44 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
pipeline {
agent any
stages {
stage('并行阶段 1') {
parallel {
stage('检出proto') {
steps {
sh 'rm -rf ./proto'
echo 'git clone https://github.com/east-eden/proto.git'
sh 'git clone -b ${BIT_BUCKET_PROTO_BRANCH_NAME} --depth=1 https://taowan:[email protected]/east-eden/proto.git'
}
}
stage('检出server') {
steps {
sh 'rm -rf ./server'
echo 'git clone https://github.com/east-eden/server.git'
sh 'git clone -b ${BIT_BUCKET_PROTO_BRANCH_NAME} --depth=1 https://taowan:[email protected]/east-eden/server.git'
}
}
}
}
stage('生成go代码') {
steps {
echo '开始生成go code'
sh 'ls -al'
sh 'pwd'
dir('proto') {
sh 'go env -w GO111MODULE=on'
sh 'go env -w GOPROXY=https://goproxy.cn,direct'
sh 'make linux_proto'
}
}
}
stage('推送到 bitbucket') {
steps {
dir('server') {
sh 'git status'
sh 'git add proto/*'
sh 'git config --global user.email "[email protected]"'
sh 'git config --global user.name "Tao Wan"'
sh 'git commit -m "自动生成pb和micropb"'
sh 'git remote -v'
sh 'git branch -v'
sh 'git push origin ${BIT_BUCKET_PROTO_BRANCH_NAME}'
}
}
}
}
}