-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
124 lines (121 loc) · 5.2 KB
/
Jenkinsfile
File metadata and controls
124 lines (121 loc) · 5.2 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
pipeline {
options {
gitLabConnection("gitlab just-ai")
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
disableConcurrentBuilds()
timeout(time: 60, unit: 'MINUTES')
timestamps()
}
agent {
label 'caila-dev-cloud-agent'
}
parameters {
string(name: "BRANCH", defaultValue: "release", description: "")
}
stages {
stage('Prepare') {
steps {
script {
env.BRANCH_NAME = env.gitlabBranch != null ? env.gitlabBranch : params.BRANCH
addBadge(cssClass: "badge-text--background badge-text--bordered", text: env.BRANCH_NAME)
}
updateGitlabCommitStatus name: "build", state: "running"
git url: "git@gitlab.just-ai.com:ml-platform-pub/mlp-java-sdk.git",
branch: "${env.BRANCH_NAME}",
credentialsId: 'bitbucket_key'
}
}
stage('Build with maven') {
steps {
script {
def pomVersion = sh(script: "mvn help:evaluate -Dexpression=project.version -q -DforceStdout", returnStdout: true).trim()
if (env.BRANCH_NAME == 'release') {
withMaven(maven: 'Maven 3.5', jdk: '17') {
sh "mvn clean deploy -U -P nexus-open-release"
}
} else {
withMaven(maven: 'Maven 3.5', jdk: '17') {
sh "mvn versions:set -DnewVersion=${env.BRANCH_NAME}-${pomVersion}-SNAPSHOT"
sh "mvn clean deploy -U -P nexus-open-snapshot"
}
}
}
}
}
stage('Rebuild MLP Services') {
when {
expression { env.BRANCH_NAME in ['release'] }
}
steps {
parallel (
"build mlp-ai-proxy" : {
build job: "mlp-ai-proxy/${env.BRANCH_NAME}", wait: false
},
"build mlp-aimyvoice-proxy-service" : {
build job: "mlp-aimyvoice-proxy-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-censorship-bot" : {
build job: "mlp-censorship-bot-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-chat-service" : {
build job: "mlp-chat-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-chit-chat-service" : {
build job: "mlp-chit-chat-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-cloud-dalle-service" : {
build job: "mlp-cloud-dalle-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-cloud-whisper-service" : {
build job: "mlp-cloud-whisper-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-cross-validation-service" : {
build job: "mlp-cross-validation-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-faq-service" : {
build job: "mlp-faq-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-gpt-mock" : {
build job: "mlp-gpt-mock-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-intents" : {
build job: "mlp-intents-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-justgpt-facade" : {
build job: "mlp-justgpt-facade-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-kaldi-asr-service" : {
build job: "mlp-kaldi-asr-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-loadtest-service" : {
build job: "mlp-loadtest-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-service-proxy" : {
build job: "mlp-service-proxy-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-summary-service" : {
build job: "mlp-summary-service-build/${env.BRANCH_NAME}", wait: false
},
"build mlp-vectorize-service" : {
build job: "mlp-vectorize-service-build/${env.BRANCH_NAME}", wait: false
}
,
)
}
}
}
post {
always {
cleanWs()
}
failure {
updateGitlabCommitStatus name: "build", state: "failed"
}
success {
updateGitlabCommitStatus name: "build", state: "success"
}
unstable {
updateGitlabCommitStatus name: "build", state: "failed"
}
}
}