Changeset ec5d599 for Jenkins


Ignore:
Timestamp:
Dec 5, 2020, 8:48:42 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
Children:
e91a255
Parents:
7c1144b (diff), ad915e0 (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

Location:
Jenkins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/Distribute

    r7c1144b rec5d599  
    2626                wrap([$class: 'TimestamperBuildWrapper']) {
    2727
    28                         final commit = prepare_build()
     28                        final commit, build
     29                        (commit, build) = prepare_build()
    2930
    3031                        node('x64') {
     
    3536
    3637                                Tools.Checkout( commit )
     38
     39                                final version = GetVersion( build )
    3740                        }
    3841
     
    7477// Main compilation routines
    7578//===========================================================================================================
     79def GetVersion(build) {
     80        final pver = sh(
     81                returnStdout: true,
     82                script: "sed 's/AC_INIT(\\[cfa-cc\\],\\[\\(.*\\)\\],\\[cforall@plg.uwaterloo.ca\\])/\\1/;t;d' ${SrcDir}/configure.ac"
     83        ).trim()
    7684
     85        final version = "${pver}.${build}"
    7786
    78 //Compilation script is done here but environnement set-up and error handling is done in main loop
    79 // def checkout() {
    80 //      build_stage('Checkout', true) {
    81 //              //checkout the source code and clean the repo
    82 //              final scmVars = checkout scm
    83 //              Settings.GitNewRef = scmVars.GIT_COMMIT
    84 //              Settings.GitOldRef = scmVars.GIT_PREVIOUS_COMMIT
     87        echo "Package Version: ${pver}"
     88        echo "Build   Version: ${build}"
     89        echo "Long    Version: ${version}"
    8590
    86 //              echo GitLogMessage()
    87 //      }
    88 // }
     91        return version
     92}
     93
    8994
    9095//===========================================================================================================
     
    107112                                        defaultValue: '',                                                               \
    108113                                ],                                                                                              \
     114                                [$class: 'StringParameterDefinition',                                           \
     115                                        description: 'Build Number to put into the version',                    \
     116                                        name: 'Build',                                                                  \
     117                                        defaultValue: '0',                                                              \
     118                                ],                                                                                              \
    109119                        ],
    110120                ]])
     
    121131        echo "Distributing git commit ${ref}"
    122132
    123         return params.GitRef
     133        return [params.GitRef, params.Build]
    124134}
    125135
  • Jenkins/tools.groovy

    r7c1144b rec5d599  
    3737                //checkout the source code and clean the repo
    3838                if(commitHash) {
    39                         final scmVars = checkout([$class: 'GitSCM', branches: [[name: commitHash ]]])
     39                        echo "Checking out commit <${commitHash}>"
     40                        final scmVars = checkout([$class: 'GitSCM', branches: [[name: commitHash ]],
     41                                userRemoteConfigs: [[
     42                                        url: 'cforall@plg.uwaterloo.ca:software/cfa/cfa-cc',
     43                                        credentialsId: 'git_key_aug20']]
     44                        ])
    4045                        echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT)
    4146                } else {
    42 
    4347                        final scmVars = checkout scm
    4448                        echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT)
     
    6165}
    6266
    63 def GitLogMessage(String oldRef, String newRef) {
     67PrevGitOldRef = ''
     68PrevGitNewRef = ''
     69def GitLogMessage(String oldRef = '', String newRef = '') {
     70        if (!oldRef) { if(!PrevGitOldRef) { return "\nERROR retrieveing current git information!\n"  } else { oldRef = PrevGitOldRef } }
     71        if (!newRef) { if(!PrevGitNewRef) { return "\nERROR retrieveing previous git information!\n" } else { newRef = PrevGitNewRef } }
     72
    6473        def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim()
    6574        def revList = SplitLines( revText )
     
    8190        gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">')
    8291        gitDiff = gitDiff.replace('[m', '</span>')
     92
     93        PrevGitOldRef = oldRef
     94        PrevGitNewRef = newRef
    8395
    8496        return """
Note: See TracChangeset for help on using the changeset viewer.