Changeset 2f19e03 for Jenkins


Ignore:
Timestamp:
Jun 15, 2021, 12:28:48 PM (5 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b51e389c
Parents:
4aba055 (diff), 4f1b8f3f (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' into andrew-mmath, collecting updates.

Location:
Jenkins
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/Distribute

    r4aba055 r2f19e03  
    22
    33import groovy.transform.Field
    4 
    5 // For skipping stages
    6 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
    74
    85//===========================================================================================================
     
    107//===========================================================================================================
    118
    12 node('master') {
    13         // Globals
    14         BuildDir  = pwd tmp: true
    15         SrcDir    = pwd tmp: false
    16         Settings  = null
    17         Version   = ''
     9// Globals
     10BuildDir  = null
     11SrcDir    = null
     12Settings  = null
     13Version   = ''
    1814
    19         // Local variables
    20         def err = null
    21         def log_needed = false
     15// Local variables
     16def err = null
     17def log_needed = false
    2218
    23         currentBuild.result = "SUCCESS"
     19currentBuild.result = "SUCCESS"
     20
     21final commit, build
     22node {
    2423
    2524        //Wrap build to add timestamp to command line
    2625        wrap([$class: 'TimestamperBuildWrapper']) {
     26                (commit, build) = prepare_build()
     27        }
     28}
    2729
    28                 final commit, build
    29                 (commit, build) = prepare_build()
    30 
    31                 node('x64') {
    32                         BuildDir  = pwd tmp: true
    33                         SrcDir    = pwd tmp: false
    34 
    35                         Tools.Clean()
    36 
    37                         Tools.Checkout( commit )
    38 
    39                         Version = GetVersion( build )
    40 
    41                         Configure()
    42 
    43                         Package()
    44 
    45                         Test()
    46 
    47                         Archive()
    48                 }
    49 
    50                 // Update the build directories when exiting the node
     30node('x64') {
     31        //Wrap build to add timestamp to command line
     32        wrap([$class: 'TimestamperBuildWrapper']) {
    5133                BuildDir  = pwd tmp: true
    5234                SrcDir    = pwd tmp: false
     35
     36                Tools.Clean()
     37
     38                Tools.Checkout( commit )
     39
     40                Version = GetVersion( build )
     41
     42                Configure()
     43
     44                Package()
     45
     46                Test()
     47
     48                Archive()
    5349        }
    54 
    5550}
    5651
  • Jenkins/FullBuild

    r4aba055 r2f19e03  
    55//===========================================================================================================
    66
    7 node ('master') {
     7node {
    88        def err = null
    99
     
    106106
    107107        if(result.result != 'SUCCESS') {
    108                 sh("wget -q -O - http://localhost:8084/jenkins/job/Cforall/job/master/${result.number}/consoleText")
     108                sh("wget -q -O - https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/${result.number}/consoleText")
    109109                error(result.result)
    110110        }
     
    144144//Email notification on a full build failure
    145145def promote_email(boolean success) {
    146         echo('notifying users')
     146        node {
     147                echo('notifying users')
    147148
    148         def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
     149                def result = success ? "PROMOTE - SUCCESS" : "PROMOTE - FAILURE"
    149150
    150         //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
    151         //Configurations for email format
    152         def email_subject = "[cforall git][${result}]"
    153         def email_body = """<p>This is an automated email from the Jenkins build machine. It was
    154 generated following the result of the C\u2200 nightly build.</p>
     151                //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
     152                //Configurations for email format
     153                def email_subject = "[cforall git][${result}]"
     154                def email_body = """<p>This is an automated email from the Jenkins build machine. It was
     155        generated following the result of the C\u2200 nightly build.</p>
    155156
    156 <p>Check console output at ${env.BUILD_URL} to view the results.</p>
     157        <p>Check console output at ${env.BUILD_URL} to view the results.</p>
    157158
    158 <p>- Status --------------------------------------------------------------</p>
     159        <p>- Status --------------------------------------------------------------</p>
    159160
    160 <p>${result}</p>
     161        <p>${result}</p>
    161162
    162 <p>- Performance ---------------------------------------------------------</p>
     163        <p>- Performance ---------------------------------------------------------</p>
    163164
    164 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" >
    165 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=1" >
     165        <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" >
     166        <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=1" >
    166167
    167 <p>- Logs ----------------------------------------------------------------</p>
    168 """
     168        <p>- Logs ----------------------------------------------------------------</p>
     169        """
    169170
    170         def email_to = "cforall@lists.uwaterloo.ca"
     171                def email_to = "cforall@lists.uwaterloo.ca"
    171172
    172         //send email notification
    173         emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
     173                //send email notification
     174                emailext body: email_body, subject: email_subject, to: email_to, attachLog: !success
     175        }
    174176}
  • Jenkins/tools.groovy

    r4aba055 r2f19e03  
    6161}
    6262
    63 PrevGitOldRef = ''
    64 PrevGitNewRef = ''
    65 def GitLogMessage(String oldRef = '', String newRef = '') {
    66         if (!oldRef) { if(!PrevGitOldRef) { return "\nERROR retrieveing current git information!\n"  } else { oldRef = PrevGitOldRef } }
    67         if (!newRef) { if(!PrevGitNewRef) { return "\nERROR retrieveing previous git information!\n" } else { newRef = PrevGitNewRef } }
    68 
     63def ConstructGitLogMessage(String oldRef, String newRef) {
    6964        def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim()
    7065        def revList = SplitLines( revText )
     
    8782        gitDiff = gitDiff.replace('[m', '</span>')
    8883
    89         PrevGitOldRef = oldRef
    90         PrevGitNewRef = newRef
     84        return """
     85<p>- Changes -------------------------------------------------------------</p>
    9186
    92         return """
    9387<pre>
    9488The branch ${env.BRANCH_NAME} has been updated.
    9589${gitUpdate}
    9690</pre>
    97 
    98 <p>Check console output at ${env.BUILD_URL} to view the results.</p>
    99 
    100 <p>- Status --------------------------------------------------------------</p>
    101 
    102 <p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p>
    10391
    10492<p>- Log -----------------------------------------------------------------</p>
     
    116104}
    117105
     106EmailMessage = ''
     107def GitLogMessage(String oldRef = '', String newRef = '') {
     108        if(!EmailMessage) {
     109                if (!oldRef) { return "\nERROR retrieveing current git information!\n"  }
     110                if (!newRef) { return "\nERROR retrieveing previous git information!\n" }
     111
     112                echo "Constructing new git message"
     113
     114                EmailMessage = ConstructGitLogMessage(oldRef, newRef)
     115        }
     116        else {
     117                echo "Reusing previously constructed message"
     118        }
     119        return EmailMessage;
     120}
     121
    118122return this;
Note: See TracChangeset for help on using the changeset viewer.