Changeset 660665f for Jenkinsfile


Ignore:
Timestamp:
Jun 29, 2021, 5:35:19 PM (3 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dcad80a
Parents:
5a46e09 (diff), d02e547 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r5a46e09 r660665f  
    77//===========================================================================================================
    88
    9 node('master') {
    10         // Globals
    11         BuildDir  = pwd tmp: true
    12         SrcDir    = pwd tmp: false
    13         Settings  = null
    14         Tools     = null
    15 
    16         // Local variables
    17         def err = null
    18         def log_needed = false
    19 
    20         currentBuild.result = "SUCCESS"
    21 
    22         try {
     9// Globals
     10BuildDir  = null
     11SrcDir    = null
     12Settings  = null
     13Tools     = null
     14
     15// Local variables
     16def err = null
     17def log_needed = false
     18
     19currentBuild.result = "SUCCESS"
     20
     21try {
     22        node {
    2323                //Wrap build to add timestamp to command line
    2424                wrap([$class: 'TimestamperBuildWrapper']) {
    25 
    2625                        Settings = prepare_build()
    27 
    28                         node(Settings.Architecture.node) {
    29                                 BuildDir  = pwd tmp: true
    30                                 SrcDir    = pwd tmp: false
    31                                 currentBuild.description = "${currentBuild.description} on ${env.NODE_NAME}"
    32 
    33                                 Tools.Clean()
    34 
    35                                 Tools.Checkout()
    36 
    37                                 build()
    38 
    39                                 test()
    40 
    41                                 benchmark()
    42 
    43                                 build_doc()
    44 
    45                                 publish()
    46                         }
    47 
    48                         // Update the build directories when exiting the node
     26                }
     27        }
     28
     29        node(Settings.Architecture.node) {
     30                //Wrap build to add timestamp to command line
     31                wrap([$class: 'TimestamperBuildWrapper']) {
    4932                        BuildDir  = pwd tmp: true
    5033                        SrcDir    = pwd tmp: false
    51                 }
    52         }
    53 
    54         //If an exception is caught we need to change the status and remember to
    55         //attach the build log to the email
    56         catch (Exception caughtError) {
    57                 // Store the result of the build log
    58                 currentBuild.result = "FAILURE"
    59 
    60                 // An error has occured, the build log is relevent
    61                 log_needed = true
    62 
    63                 // rethrow error later
    64                 err = caughtError
    65 
    66                 // print the error so it shows in the log
    67                 echo err.toString()
    68         }
    69 
    70         finally {
    71                 //Send email with final results if this is not a full build
    72                 email(log_needed)
    73 
    74                 echo 'Build Completed'
    75 
    76                 /* Must re-throw exception to propagate error */
    77                 if (err) {
    78                         throw err
    79                 }
     34                        currentBuild.description = "${currentBuild.description} on ${env.NODE_NAME}"
     35
     36                        Tools.Clean()
     37
     38                        Tools.Checkout()
     39
     40                        build()
     41
     42                        test()
     43
     44                        benchmark()
     45
     46                        build_doc()
     47
     48                        publish()
     49                }
     50        }
     51}
     52
     53//If an exception is caught we need to change the status and remember to
     54//attach the build log to the email
     55catch (Exception caughtError) {
     56        // Store the result of the build log
     57        currentBuild.result = "FAILURE"
     58
     59        // An error has occured, the build log is relevent
     60        log_needed = true
     61
     62        // rethrow error later
     63        err = caughtError
     64
     65        // print the error so it shows in the log
     66        echo err.toString()
     67}
     68
     69finally {
     70        //Send email with final results if this is not a full build
     71        email(log_needed)
     72
     73        echo 'Build Completed'
     74
     75        /* Must re-throw exception to propagate error */
     76        if (err) {
     77                throw err
    8078        }
    8179}
     
    228226//Standard build email notification
    229227def email(boolean log) {
    230         //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    231         //Configurations for email format
    232         echo 'Notifying users of result'
    233 
    234         def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
    235         def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
    236         def email_body = """<p>This is an automated email from the Jenkins build machine. It was
     228        node {
     229                //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
     230                //Configurations for email format
     231                echo 'Notifying users of result'
     232
     233                def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
     234                def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
     235                def email_body = """<p>This is an automated email from the Jenkins build machine. It was
    237236generated because of a git hooks/post-receive script following
    238237a ref change which was pushed to the C\u2200 repository.</p>
     238
     239<p>- Status --------------------------------------------------------------</p>
     240
     241<p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p>
     242<p>Check console output at ${env.BUILD_URL} to view the results.</p>
    239243""" + Tools.GitLogMessage()
    240244
    241         def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
    242 
    243         if( Settings && !Settings.Silent ) {
    244                 //send email notification
    245                 emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
    246         } else {
    247                 echo "Would send email to: ${email_to}"
    248                 echo "With title: ${email_subject}"
    249                 echo "Content: \n${email_body}"
     245                def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
     246
     247                if( Settings && !Settings.Silent ) {
     248                        //send email notification
     249                        emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
     250                } else {
     251                        echo "Would send email to: ${email_to}"
     252                        echo "With title: ${email_subject}"
     253                        echo "Content: \n${email_body}"
     254                }
    250255        }
    251256}
     
    300305        BuildSettings(java.util.Collections$UnmodifiableMap param, String branch) {
    301306                switch( param.Compiler ) {
     307                        case 'gcc-11':
     308                                this.Compiler = new CC_Desc('gcc-11', 'g++-11', 'gcc-11', '-flto=auto')
     309                        break
     310                        case 'gcc-10':
     311                                this.Compiler = new CC_Desc('gcc-10', 'g++-10', 'gcc-10', '-flto=auto')
     312                        break
    302313                        case 'gcc-9':
    303314                                this.Compiler = new CC_Desc('gcc-9', 'g++-9', 'gcc-9', '-flto=auto')
     
    319330                        break
    320331                        case 'clang':
    321                                 this.Compiler = new CC_Desc('clang', 'clang++-10', 'gcc-9', '-flto=thin -flto-jobs=0')
     332                                this.Compiler = new CC_Desc('clang', 'clang++-10', 'gcc-10', '-flto=thin -flto-jobs=0')
    322333                        break
    323334                        default :
     
    390401                                        description: 'Which compiler to use',                                   \
    391402                                        name: 'Compiler',                                                                       \
    392                                         choices: 'gcc-9\ngcc-8\ngcc-7\ngcc-6\ngcc-5\ngcc-4.9\nclang',   \
     403                                        choices: 'gcc-11\ngcc-10\ngcc-9\ngcc-8\ngcc-7\ngcc-6\ngcc-5\ngcc-4.9\nclang',   \
    393404                                        defaultValue: 'gcc-8',                                                          \
    394405                                ],                                                                                              \
Note: See TracChangeset for help on using the changeset viewer.