Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r0a346e5 r245510f  
    55//===========================================================================================================
    66//Compilation script is done here but environnement set-up and error handling is done in main loop
    7 def cfa_build(boolean full_build) {
     7def cfa_build() {
    88        build_stage 'Checkout'
    99                def install_dir = pwd tmp: true
    1010                //checkout the source code and clean the repo
    1111                checkout scm
    12 
    13                 //Clean all temporary files to make sure no artifacts of the previous build remain
    1412                sh 'git clean -fdqx'
    15 
    16                 //Reset the git repo so no local changes persist
    1713                sh 'git reset --hard'
    1814
     
    3026        build_stage 'Test'
    3127
    32                 //Run the tests from the tests directory
     28                //Run the tests from the example directory
    3329                dir ('src/tests') {
    34                         if (full_build) {
    35                                 sh 'python test.py --all'
    36                         }
    37                         else {
    38                                 sh './runTests.sh'
    39                         }
     30                        sh './runTests.sh'
    4031                }
    4132
     
    149140                                //Compile using gcc-4.9
    150141                                currentCC = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9')
    151                                 cfa_build(doPromoteBuild2DoLang)
     142                                cfa_build()
    152143
    153144                                //Compile using gcc-5
    154145                                currentCC = new CC_Desc('gcc-5', 'g++-5', 'gcc-5')
    155                                 cfa_build(doPromoteBuild2DoLang)
     146                                cfa_build()
    156147
    157148                                //Compile using gcc-4.9
    158149                                currentCC = new CC_Desc('gcc-6', 'g++-6', 'gcc-6')
    159                                 cfa_build(doPromoteBuild2DoLang)
     150                                cfa_build()
    160151
    161152                                if( doPromoteBuild2DoLang ) {
     
    194185//===========================================================================================================
    195186def notify_result(boolean promote, Exception err, String status, boolean log) {
    196         echo 'Build completed, sending result notification'
    197187        if(promote)     {
    198188                if( err ) {
     
    234224        def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
    235225
    236         def gitLog = 'Error retrieving git logs'
    237         def gitDiff = 'Error retrieving git diff'
    238 
    239         try {
    240 
    241                 sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
    242                 gitLog = readFile('GIT_LOG')
    243 
    244                 sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF"
    245                 gitDiff = readFile('GIT_DIFF')
    246         }
    247         catch (Exception error) {}
     226        sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
     227        def gitLog = readFile('GIT_LOG')
     228
     229        sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF"
     230        def gitDiff = readFile('GIT_DIFF')
    248231
    249232        def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}"
Note: See TracChangeset for help on using the changeset viewer.