11
11
*/
12
12
13
13
/**
14
- * Build the examples in the specified build and link modes.
15
- *
16
- * @param buildMode The build mode name.
17
- * @param linkMode The link mode name.
14
+ * Hold information about the pipeline.
18
15
*/
19
- void runBuildStage (String buildMode , String linkMode ) {
20
- String cmd = " python3 ${ env.WORKSPACE} /resources/ci_cd/linux_build.py"
21
- cmd + = " --build-mode ${ buildMode} "
22
- cmd + = " --link-mode ${ linkMode} "
23
- cmd + = " --build-dir ${ getBuildDirectory(buildMode, linkMode)} "
24
- command. run(cmd)
25
- }
26
-
27
- /**
28
- * Craft the build directory name.
29
- *
30
- * @param buildMode The build mode name.
31
- * @param linkMode The link mode name.
32
- */
33
- String getBuildDirectory (String buildMode , String linkMode ) {
34
- return " build_${ buildMode} _${ linkMode} "
35
- }
16
+ Map pipelineInfo = [:]
36
17
37
18
pipeline {
38
19
agent {
39
- label " ${ nodeManager .labelFromJobName()} "
20
+ label " ${ runInsideExecutor .labelFromJobName()} "
40
21
}
41
22
42
23
options {
@@ -61,29 +42,32 @@ pipeline {
61
42
timeout(time : 2 , unit : ' HOURS' )
62
43
}
63
44
64
- environment {
65
- RTI_INSTALLATION_PATH = " ${ env.WORKSPACE} "
66
- VIRTUAL_ENV = " ${ env.WORKSPACE} /.venv"
67
- }
68
-
69
45
stages {
70
- stage(' Download Packages ' ) {
46
+ stage(' Configuration ' ) {
71
47
steps {
72
48
script {
73
- nodeManager. runInsideExecutor() {
74
- command. run(
75
- ' pip3 install -r resources/ci_cd/requirements.txt'
49
+ pipelineInfo. dockerDir = " ${ env.WORKSPACE} /resources/docker/"
50
+ pipelineInfo. staticAnalysisDir = " ${ env.WORKSPACE} /static_analysis_report"
51
+ runInsideExecutor(
52
+ ' ' ,
53
+ pipelineInfo. dockerDir,
54
+ ) {
55
+ pipelineInfo. connextArch = getEnvVar(' CONNEXTDDS_ARCH' )
56
+ }
57
+ }
58
+ }
59
+ }
60
+ stage(' Download Packages' ) {
61
+ steps {
62
+ runInsideExecutor(
63
+ ' ' ,
64
+ pipelineInfo. dockerDir,
65
+ ) {
66
+ script {
67
+ pipelineInfo. connextDir = installConnext(
68
+ pipelineInfo. connextArch,
69
+ env. WORKSPACE ,
76
70
)
77
- withAWSCredentials {
78
- withCredentials([
79
- string(credentialsId : ' s3-bucket' , variable : ' RTI_AWS_BUCKET' ),
80
- string(credentialsId : ' s3-path' , variable : ' RTI_AWS_PATH' ),
81
- ]) {
82
- command. run(
83
- ' python3 resources/ci_cd/linux_install.py -a $CONNEXTDDS_ARCH'
84
- )
85
- }
86
- }
87
71
}
88
72
}
89
73
}
@@ -103,11 +87,18 @@ pipeline {
103
87
stages {
104
88
stage(' Build single mode' ) {
105
89
steps {
106
- script{
107
- nodeManager. runInsideExecutor() {
108
- echo(" Build ${ buildMode} /${ linkMode} " )
109
- runBuildStage(buildMode, linkMode)
110
- }
90
+ runInsideExecutor(
91
+ ' ' ,
92
+ pipelineInfo. dockerDir,
93
+ ) {
94
+ echo(" Building ${ buildMode} /${ linkMode} " )
95
+ buildExamples(
96
+ pipelineInfo. connextArch,
97
+ pipelineInfo. connextDir,
98
+ buildMode,
99
+ linkMode,
100
+ env. WORKSPACE ,
101
+ )
111
102
}
112
103
}
113
104
}
@@ -116,14 +107,24 @@ pipeline {
116
107
}
117
108
stage(' Static Analysis' ) {
118
109
steps {
119
- script {
120
- nodeManager. runInsideExecutor() {
121
- command. run("""
122
- python3 resources/ci_cd/linux_static_analysis.py \
123
- --build-dir ${ getBuildDirectory('release', 'dynamic')}
124
- """ )
125
- }
110
+ runInsideExecutor(
111
+ ' ' ,
112
+ pipelineInfo. dockerDir,
113
+ ) {
114
+ runStaticAnalysis(
115
+ buildExamples. getBuildDirectory(' release' , ' dynamic' ),
116
+ pipelineInfo. connextDir,
117
+ pipelineInfo. staticAnalysisDir,
118
+ )
126
119
}
120
+ publishHTML(target : [
121
+ allowMissing : true ,
122
+ alwaysLinkToLastBuild : true ,
123
+ keepAll : true ,
124
+ reportDir : pipelineInfo. staticAnalysisDir,
125
+ reportFiles : ' index.html' ,
126
+ reportName : ' LLVM Scan build static analysis' ,
127
+ ])
127
128
}
128
129
}
129
130
}
0 commit comments