Changeset 29f4fe62 for Jenkinsfile
- Timestamp:
- Jun 3, 2016, 11:21:46 AM (8 years ago)
- 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:
- 65fdb59
- Parents:
- 992c26d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r992c26d r29f4fe62 1 1 2 //=========================================================================================================== 3 // Main compilation routine 4 //=========================================================================================================== 5 //Compilation script is done here but environnement set-up and error handling is done in main loop 2 6 def build() { 3 7 build_stage 'Checkout' … … 20 24 build_stage 'Test' 21 25 22 status_prefix = 'Test' 23 26 //Run the tests from the example directory 24 27 dir ('src/examples') { 25 28 sh './runTests.sh' … … 28 31 build_stage 'Cleanup' 29 32 30 //install doesn't need to be cleaned since prefix uses temporary workspace 33 //Cleanup the install dir 34 sh "rm -rf ${install_dir}/*" 31 35 } 32 36 37 //=========================================================================================================== 38 // Helper classes/variables/routines to make the status and stage name easier to use 39 //=========================================================================================================== 40 //Description of a compiler 33 41 class CC_Desc { 34 42 String name … … 37 45 } 38 46 47 //Global Variables defining the compiler and at which point in the build we are 39 48 def currentCC 49 def status_prefix 40 50 51 //Wrapper to sync stage name and status name 41 52 def build_stage(String name) { 42 53 def stage_name = "${currentCC.name} ${name}".trim() … … 46 57 } 47 58 59 //=========================================================================================================== 60 // Main loop of the compilation 61 //=========================================================================================================== 48 62 node ('master'){ 49 63 50 64 def err = null 51 def status_prefix52 65 def log_needed = false 53 66 currentBuild.result = "SUCCESS" 54 67 55 68 try { 56 currentCC = ['gcc-4.9', 'g++-4.9', 'gcc-4.9'] as CC_Desc 57 build() 69 //Prevent the build from exceeding 30 minutes 70 timeout(30) { 71 72 //Wrap build to add timestamp to command line 73 wrap([$class: 'TimestamperBuildWrapper']) { 74 75 //Compile using gcc-4.9 76 currentCC = ['gcc-4.9', 'g++-4.9', 'gcc-4.9'] as CC_Desc 77 build() 78 79 } 80 } 58 81 59 82 } 60 83 84 //If an exception is caught we need to change the status and remember to 85 //attach the build log to the email 61 86 catch (Exception caughtError) { 87 //rethrow error later 62 88 err = caughtError 89 90 //An error has occured, the build log is relevent 63 91 log_needed = true 92 93 //Store the result of the build log 64 94 currentBuild.result = "${status_prefix} FAILURE".trim() 65 95 } … … 76 106 } 77 107 108 //=========================================================================================================== 109 //Routine responsible of sending the email notification once the build is completed 110 //=========================================================================================================== 78 111 def email(String status, boolean log) { 79 112 //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
Note: See TracChangeset
for help on using the changeset viewer.