forked from harness/harness
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
77 lines (67 loc) · 1.56 KB
/
Jenkinsfile
File metadata and controls
77 lines (67 loc) · 1.56 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
library 'z-common@feat-240314'
pipeline {
agent {
kubernetes {
inheritFrom "dind2 xuanim"
yaml '''
spec:
nodeSelector:
ci-cpu-level: high
'''
}
}
environment {
REGISTRY_HOST="hub.zentao.net"
DOCKER_CREDENTIALS_ID = 'hub-qucheng-push'
BUILD_IMAGE="${REGISTRY_HOST}/app/gitfox:dev"
BUILD_FEAT_IMAGE="${REGISTRY_HOST}/app/gitfox:feat-dev"
}
stages {
stage("Prepare") {
steps {
script {
env.XIM_USERS = sh(returnStdout: true, script: 'git show -s --format=%ce').trim()
}
}
}
stage("Build Docker Image") {
when {
branch 'zentao'
}
steps {
script {
dockerBuildx(host=env.REGISTRY_HOST, credentialsId=env.DOCKER_CREDENTIALS_ID) {
sh "docker buildx build --push --pull -t $BUILD_IMAGE ."
}
}
}
post {
success {
ximNotify(title: "Gitfox镜像构建成功", content: "$BUILD_IMAGE")
}
}
}
stage("Build Feat Docker Image") {
when {
branch 'feat'
}
steps {
script {
dockerBuildx(host=env.REGISTRY_HOST, credentialsId=env.DOCKER_CREDENTIALS_ID) {
sh "docker buildx build --push --pull -t $BUILD_FEAT_IMAGE ."
}
}
}
post {
success {
ximNotify(title: "Gitfox上游特性分支镜像构建成功", content: "$BUILD_FEAT_IMAGE")
}
}
}
}
post {
failure {
ximNotify(title: "Gitfox构建失败")
}
}
}