|
1 | 1 | void setBuildStatus(String message, String state) {
|
2 |
| - step([ |
3 |
| - $class: "GitHubCommitStatusSetter", |
4 |
| - reposSource: [$class: "ManuallyEnteredRepositorySource", url: "${REPO_URL}/owt-client-javascript"], |
5 |
| - contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/conference"], |
6 |
| - errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]], |
7 |
| - statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ] |
8 |
| - ]); |
| 2 | + step([ |
| 3 | + $class: "GitHubCommitStatusSetter", |
| 4 | + reposSource: [$class: "ManuallyEnteredRepositorySource", url: "${REPO_URL}/owt-client-javascript"], |
| 5 | + contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/conference"], |
| 6 | + errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]], |
| 7 | + statusResultSource: [$class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]]] |
| 8 | + ]); |
9 | 9 | }
|
10 | 10 |
|
11 | 11 |
|
| 12 | + |
| 13 | + |
12 | 14 | pipeline {
|
13 | 15 | agent any
|
| 16 | + options { |
| 17 | + buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) |
| 18 | + } |
14 | 19 | stages {
|
15 | 20 | stage('Unit test') {
|
16 | 21 | steps {
|
17 | 22 | podTemplate(name: 'unit-test', label: 'unit-test', cloud: 'kubernetes', containers: [
|
18 |
| - containerTemplate(name: 'unit-test', image: "$env.TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '500m', resourceLimitCpu: '1000m', network: 'host', command: 'cat') |
19 |
| - ]) { |
| 23 | + containerTemplate(name: 'unit-test', image: "$env.JSMCU_TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '500m', resourceLimitCpu: '1000m', resourceLimitMemory: '1.0Gi', resourceRequestMemory: '0.5Gi', network: 'host', command: 'cat') |
| 24 | + ]) { |
20 | 25 | node('unit-test') {
|
21 | 26 | container('unit-test') {
|
22 |
| - sh "cd /root/oms-client-javascript/test/unit/karma-test/ && ./start.sh" |
| 27 | + sh "cd /root/oms-client-javascript/test/unit/karma-test/ && ./start.sh" |
23 | 28 | }
|
24 | 29 | }
|
25 | 30 | }
|
26 | 31 | }
|
27 | 32 | }
|
28 | 33 | stage('Build package') {
|
| 34 | + options { timeout(time: 10, unit: 'MINUTES') } |
29 | 35 | steps {
|
30 | 36 | podTemplate(name: 'pack', label: 'pack-mcu', containers: [
|
31 |
| - containerTemplate(name: 'pack-on-centos', image: "$env.PACK_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '7000m', resourceLimitCpu: '8000m', network: 'host', command: 'cat') |
| 37 | + containerTemplate(name: 'pack-on-centos', image: "$env.JS_MCU_BUILD", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '1000m', resourceLimitCpu: '1500m', resourceLimitMemory: '1.5Gi', resourceRequestMemory: '1.0Gi', network: 'host', command: 'cat') |
32 | 38 | ]){
|
33 |
| - node ('pack-mcu') { |
34 |
| - container ('pack-on-centos') { |
35 |
| - sh "/root/packSDKInDocker.sh software $env.GIT_COMMIT $env.GIT_BRANCH $env.CHANGE_ID" |
36 |
| - } |
| 39 | + node('pack-mcu') { |
| 40 | + container('pack-on-centos') { |
| 41 | + sh "/root/packSDKInDocker.sh $env.GIT_COMMIT $env.GIT_BRANCH $env.CHANGE_ID" |
| 42 | + } |
37 | 43 | }
|
38 | 44 | }
|
39 | 45 | }
|
40 | 46 | }
|
41 | 47 |
|
42 | 48 | stage('Start test') {
|
| 49 | + options { timeout(time: 60, unit: 'MINUTES') } |
43 | 50 | parallel {
|
44 | 51 | stage('API test') {
|
45 | 52 | steps {
|
46 | 53 | podTemplate(name: 'api-test', label: 'api-test', cloud: 'kubernetes', containers: [
|
47 |
| - containerTemplate(name: 'api-test', image: "$env.TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '3000m', resourceLimitCpu: '4000m', network: 'host', command: 'cat'), |
48 |
| - ]) { |
49 |
| - |
| 54 | + containerTemplate(name: 'api-test', image: "$env.JSMCU_TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'), |
| 55 | + ]) { |
| 56 | + |
50 | 57 | node('api-test') {
|
51 |
| - container('api-test') { |
52 |
| - sh "/root/start.sh ${env.GIT_COMMIT}1 ConferenceClient_api" |
53 |
| - } |
| 58 | + container('api-test') { |
| 59 | + sh "/root/start.sh ${env.GIT_COMMIT}1 ConferenceClient_api" |
| 60 | + } |
54 | 61 | }
|
55 | 62 | }
|
56 | 63 | }
|
57 | 64 | }
|
58 | 65 |
|
59 | 66 | stage('Subscribe test') {
|
60 | 67 | steps {
|
61 |
| - podTemplate(name:'subscribe-test', label: 'subscribe-test', cloud: 'kubernetes', containers: [ |
62 |
| - containerTemplate(name: 'subscribe-test', image: "$env.TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '3000m', resourceLimitCpu: '4000m', network: 'host', command: 'cat'), |
63 |
| - ]) { |
64 |
| - |
| 68 | + podTemplate(name: 'subscribe-test', label: 'subscribe-test', cloud: 'kubernetes', containers: [ |
| 69 | + containerTemplate(name: 'subscribe-test', image: "$env.JSMCU_TEST_IMAGE", ttyEnabled: true, alwaysPullImage: true, privileged: true, resourceRequestCpu: '8000m', resourceLimitCpu: '9000m', resourceLimitMemory: '10.0Gi', resourceRequestMemory: '9.0Gi', network: 'host', command: 'cat'), |
| 70 | + ]) { |
| 71 | + |
65 | 72 | node('subscribe-test') {
|
66 |
| - container('subscribe-test') { |
67 |
| - sh "/root/start.sh ${env.GIT_COMMIT}2 ConferenceClient_subscribe" |
68 |
| - } |
| 73 | + container('subscribe-test') { |
| 74 | + sh "/root/start.sh ${env.GIT_COMMIT}2 ConferenceClient_subscribe" |
| 75 | + } |
69 | 76 | }
|
70 | 77 | }
|
71 | 78 | }
|
|
0 commit comments