Changeset 24272


Ignore:
Timestamp:
10/24/19 20:58:34 (5 years ago)
Author:
jdquinn
Message:

CHG: New check so that JavaScript build does not recompile unnecessarily each time; documentation and formatting (more to come later)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/jenkins/jenkins.sh

    r24271 r24272  
    11#!/bin/bash
    2 #This bash script calls the nightlyrun.m matlab file to run our nightly test decks.
    3 #It then processes the results and sends an email to the Ice developpers.
     2################################################################################
     3# This bash script manages installation of ISSM on a given Jenkins node using a
     4# configuration file passed as the only argument. This file also contains
     5# details about which nightly run tests should be executed after the build has
     6# been completed. Finally, results of the build and tests are emailed to the
     7# members of the ISSM development team.
     8#
     9# TODO:
     10# - Rename TEMP to something more descriptive
     11# - Ensure first that other parts of the build system do not rely on this
     12#       name
     13# - Investigate refactoring parsing of list of changed files
     14################################################################################
    415
    516echo "Cleaning up execution directory"
     
    5364        echo "Current  revision number: $SVN_CURRENT"
    5465
    55         #Get changes from jenkins itself (svn requires credentials)
     66        # Get list of changed files
     67        #
     68
    5669        #svn --non-interactive --no-auth-cache --trust-server-cert diff -r $SVN_PREVIOUS:$SVN_CURRENT --summarize $ISSM_DIR | awk '{print $NF}' > $ISSM_DIR/TEMP
     70
     71        # Get list of changes from Jenkins itself as svn requires credentials
    5772        rm -rf changes
    5873        wget $SERVER/job/$JOB_NAME/$BUILD_NUMBER/changes > /dev/null 2>&1
    5974
    60         #Process html page and get the list of files that has changed (tricky...)
     75        # Process html page and get the list of files that has changed (tricky...)
    6176        #cat changes | grep '="The file was modified"' | sed -e 's/.*<\/td><td><a>\(.*\)<\/a><\/td><td>.*/\1/' > $ISSM_DIR/TEMP
    6277        #cat changes | grep 'document_edit' |sed -e 's/document_edit.png/document_edit.png\
    6378                #/g' | sed -e 's/.*<\/a><\/td><td>\(.*\)<\/td><\/tr>.*/\1/' | grep -v 'document_edit.png' > $ISSM_DIR/TEMP
    64         cat changes  | tr " " "\n" | grep trunk |  sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
    65 
    66         #Print list of files
     79        cat changes  | tr " " "\n" | grep trunk | sed -e 's/.*<a>\(.*\)<\/a>.*/\1/' > $ISSM_DIR/TEMP
     80
     81        # Print list of changed files
    6782        echo "   "
    6883        echo "List of updated files"
     
    7085        echo "   "
    7186
    72         #Do we need to reinstall externalpackages?
     87        ###################################
     88        ### Determine installation type ###
     89        ###################################
    7390        echo "Determining installation type"
     91
     92        # If the contents of the externalpackages directory were modified in any
     93        # way, check for changed external packages
    7494        if [ ! -z "$(cat $ISSM_DIR/TEMP | grep externalpackages)" ] ; then
    7595                echo "  -- checking for changed externalpackages... yes";
     
    80100        fi
    81101
    82         #Do we need to reconfigure
     102        # If the Makefile or m4 diirectory were changed in any way or if certain
     103        # binary files from a previous compilation do not exist, reconfigure
    83104        if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "Makefile.am" -e "m4" )" ] ||
    84                 [ ! -f "$ISSM_DIR/bin/issm.exe" ] ||
     105                [ ! -f "$ISSM_DIR/bin/issm.exe" ] && [ ! -f "$ISSM_DIR/bin/issm-bin.js" ] ||
    85106                [ "$ISSM_EXTERNALPACKAGES" == "yes" ] ;
    86107        then
     
    92113        fi
    93114
    94         #Do we need to recompile
     115        # If source files were changed in any way, recompile
    95116        if [ ! -z "$(cat $ISSM_DIR/TEMP | grep -e "\.cpp" -e "\.h" )" ] ||
    96117                [ "$ISSM_RECONFIGURE" == "yes" ] ;
     
    102123                ISSM_COMPILATION="no"
    103124        fi
    104         #ISSM_COMPILATION="yes"
     125
     126        # Cleanup
    105127        rm changes
    106128        rm $ISSM_DIR/TEMP
    107 
    108129else
    109130        echo "Previous revision not found, this must be a fresh install"
     
    115136        ISSM_COMPILATION="yes"
    116137fi
     138
    117139echo " "
    118140echo "Recording current svn version: $SVN_REVISION_1"
Note: See TracChangeset for help on using the changeset viewer.