This repository was archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathconference.jenkinsfile
103 lines (91 loc) · 5.15 KB
/
conference.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
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
void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "${REPO_URL}/owt-client-javascript"],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/conference"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [$class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]]]
]);
}
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
stages {
stage('Build package') {
options { timeout(time: 20, unit: 'MINUTES') }
steps {
podTemplate(name: 'pack-js-centos-'+env.GIT_BRANCH, label: 'pack-js-centos-'+env.GIT_BRANCH,
volumes: [
persistentVolumeClaim(claimName: 'stability-package',mountPath: '/root/stabilityPackage',readOnly: false),
persistentVolumeClaim(claimName: 'js-centos-package',mountPath: '/root/centos_package',readOnly: false),
persistentVolumeClaim(claimName: 'webrtc88',mountPath: '/root/owt-server/third_party/webrtc-m88',readOnly: false)
],
containers: [
containerTemplate(name: 'build-images', image: "$env.centos_build_images", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '5000m', resourceLimitCpu: '6000m' , command: 'cat')
]){
node('pack-js-centos-'+env.GIT_BRANCH) {
container('build-images') {
sh "/root/startRun.sh * * centos build javascript $env.GIT_BRANCH $env.GIT_COMMIT $env.CHANGE_ID"
}
}
}
}
}
stage('Start test') {
options { timeout(time: 40, unit: 'MINUTES') }
parallel {
stage('ConferenceClient API 1') {
steps {
podTemplate(name: 'api-js-centos-'+env.GIT_BRANCH, label: 'api-js-centos-'+env.GIT_BRANCH, cloud: 'kubernetes',
volumes: [
persistentVolumeClaim(claimName: 'js-centos-package', mountPath: '/root/centos_package', readOnly: false),
persistentVolumeClaim(claimName: 'js-centos-log', mountPath: '/root/centos_log', readOnly: false)
],
containers: [
containerTemplate(name: 'test-images', image: "$env.centos_test_images", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '3000m', resourceLimitCpu: '4000m', resourceRequestMemory: '2.0Gi', resourceLimitMemory: '3.0Gi', command: 'cat'),
]) {
node('api-js-centos-'+env.GIT_BRANCH) {
container('test-images') {
sh "/root/startRun.sh * * centos test ${env.GIT_COMMIT} ConferenceClient_API_1 $env.GIT_BRANCH"
}
}
}
}
}
stage('ConferenceClient API 2') {
steps {
podTemplate(name: 'rest-js-centos-'+env.GIT_BRANCH, label: 'rest-js-centos-'+env.GIT_BRANCH, cloud: 'kubernetes',
volumes: [
persistentVolumeClaim(claimName: 'js-centos-package', mountPath: '/root/centos_package', readOnly: false),
persistentVolumeClaim(claimName: 'js-centos-log', mountPath: '/root/centos_log', readOnly: false)
],
containers: [
containerTemplate(name: 'test-images', image: "$env.centos_test_images", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '3000m', resourceLimitCpu: '4000m', resourceRequestMemory: '2.0Gi', resourceLimitMemory: '3.0Gi', command: 'cat'),
]) {
node('rest-js-centos-'+env.GIT_BRANCH) {
container('test-images') {
sh "/root/startRun.sh * * centos test ${env.GIT_COMMIT} ConferenceClient_API_2 $env.GIT_BRANCH"
}
}
}
}
}
}
}
}
post {
always {
script {
sh "curl -H \"Content-Type: application/json\" -X POST --data '{\"commit_id\":\"'$GIT_COMMIT'\",\"job_path\":\"'${env.JS_CHECK_PATH}'\",\"job_name\":\"'$JOB_BASE_NAME'\",\"build_num\":\"'$BUILD_NUMBER'\",\"os_version\":\"'$env.CENTOS_VERSION'\"}' '${env.checkServerUrl}'/runServer/JS_BUILD_CONFERENCE_STEPS"
}
}
success {
setBuildStatus("Build succeeded", "SUCCESS");
}
failure {
setBuildStatus("Build failed", "FAILURE");
}
}
}