Rate This Document
Findability
Accuracy
Completeness
Readability

Jenkins Pipeline Sample Code

The sample code is as follows:

stage('64-bit-running-mode-check') {
                            steps {
                                echo '====== 64-bit running mode check======'
                                sh '''
                                   if [ ! -d "./report_dir" ]; then mkdir -p ./report_dir; fi
                                   /usr/bin/rm -rf ./report_dir/*.html
                                   devkit advisor run-mode -i /opt/DevKit/testcase/affinity/precheck/test005 -c make -r html -o ./report_dir
                                    mv ./report_dir/mode_check*.html ./report_dir/64-bit-running-mode-check.html
                                '''
                            }
                            post {
                                always {
                                    publishHTML(target: [allowMissing: false,
                                                alwaysLinkToLastBuild: false,
                                                keepAll              : true,
                                                reportDir            : './report_dir',
                                                reportFiles          : '64-bit-running-mode-check.html',
                                                reportName           : '64-bit-running-mode-check Report']
                                                )
                                }
                            }
                        }
  • You are advised to perform the 64-bit running mode check before the build process.
  • /opt/DevKit/testcase/affinity/precheck/test005 indicates the path to the source code folder to be scanned. Replace it with the actual path.