Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r27474a7 r6bde81d  
    277277                        //Use the current directory as the installation target so nothing escapes the sandbox
    278278                        //Also specify the compiler by hand
    279                         sh "${srcdir}/configure CXX=${compiler.cpp_cc} ${architecture} --with-backend-compiler=${compiler.cfa_cc} --enable-silent-rules --quiet"
     279                        targets=""
     280                        if(do_alltests) {
     281                                targets="--with-target-hosts='host:debug,host:nodebug'"
     282                        } else {
     283                                targets="--with-target-hosts='host:debug'"
     284                        }
     285
     286                        sh "${srcdir}/configure CXX=${compiler.cpp_cc} ${architecture} ${targets} --with-backend-compiler=${compiler.cfa_cc} --quiet"
    280287
    281288                        //Compile the project
     
    291298                        //Run the tests from the tests directory
    292299                        if ( do_alltests ) {
    293                                 sh 'make --no-print-directory -C src/tests all-tests debug=yes'
    294                                 sh 'make --no-print-directory -C src/tests all-tests debug=no '
     300                                sh 'make --no-print-directory -C tests all-tests debug=yes'
     301                                sh 'make --no-print-directory -C tests all-tests debug=no '
    295302                        }
    296303                        else {
    297                                 sh 'make --no-print-directory -C src/tests'
     304                                sh 'make --no-print-directory -C tests'
    298305                        }
    299306                }
     
    308315                dir (builddir) {
    309316                        //Append bench results
    310                         sh "make --no-print-directory -C src/benchmark jenkins githash=${gitRefNewValue} arch=${arch_name} | tee ${srcdir}/bench.json"
     317                        sh "make --no-print-directory -C benchmark jenkins githash=${gitRefNewValue} arch=${arch_name} | tee ${srcdir}/bench.json"
    311318                }
    312319        }
     
    341348//Routine responsible of sending the email notification once the build is completed
    342349//===========================================================================================================
     350def gitBranchUpdate(String gitRefOldValue, String gitRefNewValue) {
     351        def update = ""
     352        sh "git rev-list ${gitRefOldValue}..${gitRefNewValue} > GIT_LOG";
     353        readFile('GIT_LOG').eachLine { rev ->
     354                sh "git cat-file -t ${rev} > GIT_TYPE"
     355                def type = readFile('GIT_TYPE')
     356
     357                update += "       via  ${rev} (${type})\n"
     358        }
     359        def rev = gitRefOldValue
     360        sh "git cat-file -t ${rev} > GIT_TYPE"
     361        def type = readFile('GIT_TYPE')
     362
     363        update += "      from  ${rev} (${type})\n"
     364        return update
     365
     366def output=readFile('result').trim()
     367echo "output=$output";
     368}
     369
    343370//Standard build email notification
    344371def email(String status, boolean log, boolean bIsSandbox) {
     
    349376        def gitLog = 'Error retrieving git logs'
    350377        def gitDiff = 'Error retrieving git diff'
     378        def gitUpdate = 'Error retrieving update'
    351379
    352380        try {
     381                gitUpdate = gitBranchUpdate(gitRefOldValue, gitRefNewValue)
    353382
    354383                sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
     
    358387                gitDiff = readFile('GIT_DIFF')
    359388        }
    360         catch (Exception error) {}
     389        catch (Exception error) {
     390                echo error.toString()
     391                echo error.getMessage()
     392        }
    361393
    362394        def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${status}] - branch ${env.BRANCH_NAME}"
     
    367399
    368400The branch ${env.BRANCH_NAME} has been updated.
    369    via  ${gitRefOldValue} (commit)
    370   from  ${gitRefNewValue} (commit)
     401${gitUpdate}
    371402
    372403Check console output at ${env.BUILD_URL} to view the results.
Note: See TracChangeset for help on using the changeset viewer.