Changeset 77f347d


Ignore:
Timestamp:
Jun 3, 2016, 10:53:27 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
848fb00
Parents:
4df85197
Message:

Modified jenkins file to remove all before running

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r4df85197 r77f347d  
    11
     2def build() {
     3        build_stage 'Checkout'
     4
     5                //checkout the source code and clean the repo
     6                sh 'rm -rf *'
     7                checkout scm
     8
     9        build_stage 'Build'
     10
     11                //Configure the conpilation (Output is not relevant)
     12                //Use the current directory as the installation target so nothing
     13                //escapes the sandbox
     14                //Also specify the compiler by hand
     15                def install_dir = pwd tmp: true
     16                sh "CC=gcc-4.9 CXX=g++-4.9 ./configure --prefix=${install_dir} > /dev/null"
     17
     18                //Compile the project
     19                sh 'make -j 8 install'
     20
     21        build_stage 'Test'
     22
     23                status_prefix = 'Test'
     24
     25                dir ('src/examples') {
     26                        sh './runTests.sh'
     27                }
     28
     29        build_stage 'Cleanup'
     30
     31                //install doesn't need to be cleaned since prefix uses temporary workspace
     32}
     33
     34def Compiler
     35
     36def build_stage(String name) {
     37        def stage_name = "${Compiler} ${name}"
     38        stage stage_name
     39
     40                status_prefix = stage_name
     41}
    242
    343node ('master'){
    444
    545        def err = null
    6         def stage_name
     46        def status_prefix
    747        def log_needed = false
    848        currentBuild.result = "SUCCESS"
    949
    1050        try {
     51                Compiler = 'gcc-4.9'
     52                build()
    1153
    12                 stage 'Checkout'
    13 
    14                         //checkout the source code and clean the repo
    15                         checkout scm
    16                         sh 'git clean -dfq'
    17 
    18                 stage 'Build'
    19 
    20                         stage_name = 'Build'
    21 
    22                         //Clean the directory (Output is not relevant)
    23                         sh 'make clean > /dev/null'
    24 
    25                         //Configure the conpilation (Output is not relevant)
    26                         //Use the current directory as the installation target so nothing
    27                         //escapes the sandbox
    28                         //Also specify the compiler by hand
    29                         def install_dir = pwd tmp: true
    30                         sh "CC=gcc-4.9 CXX=g++-4.9 ./configure --prefix=${install_dir} > /dev/null"
    31 
    32                         //Compile the project
    33                         sh 'make -j 8 install'
    34 
    35                 stage 'Test'
    36 
    37                         stage_name = 'Test'
    38 
    39                         dir ('src/examples') {
    40                                 sh './runTests.sh'
    41                         }
    42 
    43                 stage 'Cleanup'
    44 
    45                         //install doesn't need to be cleaned since prefix uses temporary workspace
    4654        }
    4755
     
    4957                err = caughtError
    5058                log_needed = true
    51                 currentBuild.result = "FAILURE"
    52 
    53                 switch(stage_name) {
    54                         case 'Test' :
    55                                 currentBuild.result = "TEST FAILURE"
    56                                 break
    57                         default :
    58                                 break
    59                 }
     59                currentBuild.result = "${status_prefix} FAILURE"
    6060        }
    6161
Note: See TracChangeset for help on using the changeset viewer.