summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-10-06 13:59:50 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-06 13:59:50 -0400
commit8b43028bf74afde117219b11a835b0e274fe6830 (patch)
treea0e04e3bbcf6aad50c54da9f6cfbab4c0b56c1cb
parentb220fb6e61befc39d139383056671eacc8c0b7dc (diff)
downloadbuild_tools-8b43028bf74afde117219b11a835b0e274fe6830.zip
build_tools-8b43028bf74afde117219b11a835b0e274fe6830.tar.gz
build_tools-8b43028bf74afde117219b11a835b0e274fe6830.tar.xz
Don't run if there are no changes
-rwxr-xr-xsssd-nightly.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/sssd-nightly.sh b/sssd-nightly.sh
index b9b366f..c2c4c8f 100755
--- a/sssd-nightly.sh
+++ b/sssd-nightly.sh
@@ -1,4 +1,8 @@
function finish { #(exit code)
+ if [ x$scratch_build != x ]; then
+ exit $1
+ fi
+
recipients="sgallagh@redhat.com jgalipea@redhat.com"
if [ $1 -eq 0 ]; then
@@ -22,6 +26,7 @@ today=`date +%Y%m%d`
git_repo=$2
if [ x$git_repo == x ]; then
git_repo=git://git.fedorahosted.org/sssd.git
+ scratch_build=1
fi
LOGFILE=/local/sgallagh/logs/nightly-$datestamp.log
@@ -37,6 +42,15 @@ git clone $git_repo sssd-$datestamp >> $LOGFILE 2>&1
cd sssd-$datestamp
commit_id=`git log -1 --pretty=format:%h`
+
+# See if the commit_id is different from the last run
+old_commit_id=`cat /local/sgallagh/.commit`
+if [ x$commit_id == x$old_commit_id ]; then
+ cd /local/sgallagh && rm -Rf sssd-$datestamp
+ rm -f $LOGFILE
+ exit 0
+fi
+
prereleaseversion=".${datestamp}git${commit_id}"
echo $nextversion > VERSION
echo $prereleaseversion >> VERSION
@@ -178,6 +192,9 @@ fi
echo "===== Removing Source Tree =====" >> $LOGFILE
cd /local/sgallagh && rm -Rf sssd-$datestamp
+#Save the commit id for the next time
+echo $commit_id > /local/sgallagh/.commit
+
echo "===== BUILD CONCLUDED AT `date` =====" >> $LOGFILE
finish 0