Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkins/FullBuild

    re67f54c r644ec6a  
    44// Main compilation routines
    55//===========================================================================================================
     6
     7def trigger_build(String arch) {
     8        def result = build job: 'Cforall/master',               \
     9                parameters: [                                           \
     10                        [$class: 'BooleanParameterValue',               \
     11                          name: 'isFullBuild',                          \
     12                          value: true],                                         \
     13                        [$class: 'StringParameterValue',                \
     14                          name: 'buildArchitecture',                    \
     15                          value: arch]                                  \
     16                ]
     17
     18        echo(result.result)
     19        echo(result.absoluteUrl)
     20}
     21
    622def push_build() {
    723        //Don't use the build_stage function which outputs the compiler
     
    1228                def out_dir = pwd tmp: true
    1329                sh "mkdir -p ${out_dir}"
     30
     31                //checkout the code to make sure this is a valid git repo
     32                checkout scm
     33
     34                collect_git_info()
    1435
    1536                //parse git logs to find what changed
     
    2243                }
    2344
    24                 sh "git push DoLang ${gitRefNewValue}:master"
     45                sh "GIT_SSH_COMMAND=\"ssh -v\" git push DoLang ${gitRefNewValue}:master"
     46}
     47
     48//Helper routine to collect information about the git history
     49def collect_git_info() {
     50
     51        //create the temporary output directory in case it doesn't already exist
     52        def out_dir = pwd tmp: true
     53        sh "mkdir -p ${out_dir}"
     54
     55        //parse git logs to find what changed
     56        dir("../Cforall_Full_Build@script") {
     57                sh "git reflog > ${out_dir}/GIT_COMMIT"
     58        }
     59        git_reflog = readFile("${out_dir}/GIT_COMMIT")
     60        gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
     61        gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]
    2562}
    2663
     
    2865// Main loop of the compilation
    2966//===========================================================================================================
    30 node ('master'){
     67
     68node ('master') {
    3169        try {
    3270                //Prevent the build from exceeding 30 minutes
     
    3876                                stage 'Build'
    3977
    40                                         parallel (
    41                                                 x64: { node ('master') {
    42                                                         build job: 'Cforall/master',                                    \
    43                                                                 parameters: [                                           \
    44                                                                         [$class: 'BooleanParameterValue',               \
    45                                                                           name: 'isFullBuild',                          \
    46                                                                           value: true],                                         \
    47                                                                         [$class: 'StringParameterValue',                \
    48                                                                           name: 'buildArchitecture',                    \
    49                                                                           value: '64-bit']                              \
    50                                                                 ]
    51                                                 }},
    52                                                 x32: { node ('master') {
    53                                                         build job: 'Cforall/master',                                    \
    54                                                                 parameters: [                                           \
    55                                                                         [$class: 'BooleanParameterValue',               \
    56                                                                           name: 'isFullBuild',                          \
    57                                                                           value: true],                                         \
    58                                                                         [$class: 'StringParameterValue',                \
    59                                                                           name: 'buildArchitecture',                    \
    60                                                                           value: '32-bit']                              \
    61                                                                 ]
    62                                                 }}
    63                                         )
     78                                        results = [null, null]
     79
     80                                        // parallel (
     81                                        //      x64: {
     82                                        //              trigger_build('64-bit')
     83                                        //      },
     84                                        //      x32: {
     85                                        //              trigger_build('32-bit')
     86                                        //      }
     87                                        // )
    6488
    6589                                //Push latest changes to do-lang repo
    66                                 //push_build()
     90                                push_build()
    6791                        }
    6892                }
     
    79103
    80104                //Send email to notify the failure
    81                 //promote_email(currentBuild.result)
     105                promote_email(currentBuild.result)
    82106        }
    83107
     
    89113        }
    90114}
    91 
    92115//===========================================================================================================
    93116//Routine responsible of sending the email notification once the build is completed
Note: See TracChangeset for help on using the changeset viewer.