1111 */
1212
1313/**
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.
1815 */
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 = [:]
3617
3718pipeline {
3819 agent {
39- label " ${ nodeManager .labelFromJobName()} "
20+ label " ${ runInsideExecutor .labelFromJobName()} "
4021 }
4122
4223 options {
@@ -61,29 +42,32 @@ pipeline {
6142 timeout(time : 2 , unit : ' HOURS' )
6243 }
6344
64- environment {
65- RTI_INSTALLATION_PATH = " ${ env.WORKSPACE} "
66- VIRTUAL_ENV = " ${ env.WORKSPACE} /.venv"
67- }
68-
6945 stages {
70- stage(' Download Packages ' ) {
46+ stage(' Configuration ' ) {
7147 steps {
7248 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 ,
7670 )
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- }
8771 }
8872 }
8973 }
@@ -103,11 +87,18 @@ pipeline {
10387 stages {
10488 stage(' Build single mode' ) {
10589 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+ )
111102 }
112103 }
113104 }
@@ -116,14 +107,24 @@ pipeline {
116107 }
117108 stage(' Static Analysis' ) {
118109 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+ )
126119 }
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+ ])
127128 }
128129 }
129130 }
0 commit comments