Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/FullBuild

    r14ce3392 r5a11e07  
    11#!groovy
    22
    3 //===========================================================================================================
    4 // Main loop of the compilation
    5 //===========================================================================================================
    6 
    7 node ('master') {
    8         def err = null
    9 
    10         try {
    11                 //Prevent the build from exceeding 30 minutes
    12                 timeout(60) {
    13 
    14                         //Wrap build to add timestamp to command line
    15                         wrap([$class: 'TimestamperBuildWrapper']) {
    16 
    17                                 stage 'Build'
    18 
    19                                         results = [null, null]
    20 
    21                                         parallel (
    22                                                 gcc_6_x64: { trigger_build( 'gcc-6',   'x64' ) },
    23                                                 gcc_6_x86: { trigger_build( 'gcc-6',   'x86' ) },
    24                                                 gcc_5_x64: { trigger_build( 'gcc-5',   'x64' ) },
    25                                                 gcc_5_x86: { trigger_build( 'gcc-5',   'x86' ) },
    26                                                 gcc_4_x64: { trigger_build( 'gcc-4.9', 'x64' ) },
    27                                                 gcc_4_x86: { trigger_build( 'gcc-4.9', 'x86' ) },
    28                                                 clang_x64: { trigger_build( 'clang',   'x64' ) },
    29                                                 clang_x86: { trigger_build( 'clang',   'x86' ) },
    30                                         )
    31 
    32                                 //Push latest changes to do-lang repo
    33                                 push_build()
    34                         }
    35                 }
    36         }
    37 
    38         //If an exception is caught we need to change the status and remember to
    39         //attach the build log to the email
    40         catch (Exception caughtError) {
    41                 echo('error caught')
    42 
    43                 //rethrow error later
    44                 err = caughtError
    45 
    46                 //Store the result of the build log
    47                 currentBuild.result = 'FAILURE'
    48 
    49                 //Send email to notify the failure
    50                 promote_failure_email()
    51         }
    52 
    53         finally {
    54                 //Must re-throw exception to propagate error
    55                 if (err) {
    56                         throw err
    57                 }
    58         }
    59 }
    603//===========================================================================================================
    614// Main compilation routines
    625//===========================================================================================================
    636
    64 def trigger_build(String cc, String arch) {
     7def trigger_build(String arch) {
    658        def result = build job: 'Cforall/master',               \
    669                parameters: [                                           \
     10                        [$class: 'BooleanParameterValue',               \
     11                          name: 'isFullBuild',                          \
     12                          value: true],                                         \
    6713                        [$class: 'StringParameterValue',                \
    68                           name: 'pCompiler',                            \
    69                           value: cc],                                   \
    70                         [$class: 'StringParameterValue',                \
    71                           name: 'pArchitecture',                        \
    72                           value: arch],                                 \
    73                         [$class: 'BooleanParameterValue',               \
    74                           name: 'pRunAllTests',                         \
    75                           value: true],                                         \
    76                         [$class: 'BooleanParameterValue',               \
    77                           name: 'pRunBenchmark',                        \
    78                           value: true],                                         \
    79                         [$class: 'BooleanParameterValue',               \
    80                           name: 'pBuildDocumentation',          \
    81                           value: true],                                         \
    82                         [$class: 'BooleanParameterValue',               \
    83                           name: 'pPublish',                             \
    84                           value: true],                                         \
    85                         [$class: 'BooleanParameterValue',               \
    86                           name: 'pSilent',                              \
    87                           value: true],                                         \
     14                          name: 'buildArchitecture',                    \
     15                          value: arch]                                  \
    8816                ],                                                              \
    8917                propagate: false
     
    14169
    14270//===========================================================================================================
     71// Main loop of the compilation
     72//===========================================================================================================
     73
     74node ('master') {
     75        def err = null
     76
     77        try {
     78                //Prevent the build from exceeding 30 minutes
     79                timeout(60) {
     80
     81                        //Wrap build to add timestamp to command line
     82                        wrap([$class: 'TimestamperBuildWrapper']) {
     83
     84                                stage 'Build'
     85
     86                                        results = [null, null]
     87
     88                                        parallel (
     89                                                x64: {
     90                                                        trigger_build('64-bit')
     91                                                },
     92                                                x32: {
     93                                                        trigger_build('32-bit')
     94                                                }
     95                                        )
     96
     97                                //Push latest changes to do-lang repo
     98                                push_build()
     99                        }
     100                }
     101        }
     102
     103        //If an exception is caught we need to change the status and remember to
     104        //attach the build log to the email
     105        catch (Exception caughtError) {
     106                echo('error caught')
     107
     108                //rethrow error later
     109                err = caughtError
     110
     111                //Store the result of the build log
     112                currentBuild.result = 'FAILURE'
     113
     114                //Send email to notify the failure
     115                promote_failure_email()
     116        }
     117
     118        finally {
     119                //Must re-throw exception to propagate error
     120                if (err) {
     121                        throw err
     122                }
     123        }
     124}
     125//===========================================================================================================
    143126//Routine responsible of sending the email notification once the build is completed
    144127//===========================================================================================================
Note: See TracChangeset for help on using the changeset viewer.