diff options
author | Memphiz <memphis@machzwo.de> | 2014-11-20 14:09:44 +0100 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2014-11-20 15:15:08 +0100 |
commit | f6d7b1d51e3959b7f9d5003b5f24902120e6d7df (patch) | |
tree | c2a2f733322306988d0cfda82a0a9050ee5fa589 /tools/buildsteps/defaultenv | |
parent | 327f4a3f9e66992f8d5d1300ed68d1021da2057e (diff) |
[jenkins] - refactor jenkins scripts to centralise the decision for
rebuilding depends - add project/cmake dir as criterion
Diffstat (limited to 'tools/buildsteps/defaultenv')
-rw-r--r-- | tools/buildsteps/defaultenv | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tools/buildsteps/defaultenv b/tools/buildsteps/defaultenv index d709f986a1..76ebb84a52 100644 --- a/tools/buildsteps/defaultenv +++ b/tools/buildsteps/defaultenv @@ -100,7 +100,7 @@ function pathChanged () checkPath="$1" if [ -e $checkPath/$PATH_CHANGE_REV_FILENAME ] then - if [ "$(cat $checkPath/$PATH_CHANGE_REV_FILENAME)" != "$(getBuildHash $WORKSPACE/tools/depends)" ] + if [ "$(cat $checkPath/$PATH_CHANGE_REV_FILENAME)" != "$(getBuildHash $checkPath)" ] then ret="1" fi @@ -111,11 +111,26 @@ function pathChanged () echo $ret } -function tagSuccessFulBuild () +function rebuildDepends () { - local checkPath - checkPath="$1" - echo "$(getBuildHash $checkPath)" > $checkPath/$PATH_CHANGE_REV_FILENAME + local ret + ret="0" + # check if depends need to be rebuilt - this is done by checking last + # successfull build revision of depends and cmake dir + if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] || [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] + then + ret="1" + fi + + echo $ret +} + +function tagSuccessFulDependsBuild () +{ + # tag last successful build of depends by marking the revisions of depends and cmake dir + # needs to match the checks in function rebuildDepends + echo "$(getBuildHash $WORKSPACE/tools/depends)" > $WORKSPACE/tools/depends/$PATH_CHANGE_REV_FILENAME + echo "$(getBuildHash $WORKSPACE/project/cmake)" > $WORKSPACE/project/cmake/$PATH_CHANGE_REV_FILENAME } function getBranchName () |