-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
65 lines (57 loc) · 1.9 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
53
54
55
56
57
58
59
60
61
62
63
64
@Library('jenkins-shared-library@v0.6.3') _
def pod = libraryResource 'io/milvus/pod/tekton.yaml'
pipeline {
options {
skipDefaultCheckout true
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '5'))
}
agent {
kubernetes {
cloud '4am'
yaml pod
}
}
stages {
stage('build-and-push') {
steps {
container('kubectl') {
script {
isPr = env.CHANGE_ID != null
gitMode = isPr ? 'merge' : 'fetch'
gitBaseRef = isPr ? "$env.CHANGE_TARGET" : "$env.BRANCH_NAME"
job_name = tekton.buildConanfiles arch: 'amd64',
conan_version: "1.64.0",
isPr: isPr,
gitMode: gitMode ,
gitBaseRef: gitBaseRef,
pullRequestNumber: "$env.CHANGE_ID"
}
}
container('tkn') {
script {
try {
tekton.print_log(job_name)
} catch (Exception e) {
println e
}
tekton.check_result(job_name)
}
}
}
post {
// always sure to stop the tekton job
always {
container('tkn') {
script {
try {
tekton.cancel(job_name)
} catch (Exception e) {
}
}
}
}
}
}
}
}