summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsssd-nightly.sh58
1 files changed, 40 insertions, 18 deletions
diff --git a/sssd-nightly.sh b/sssd-nightly.sh
index 52c56ee..7c81e8e 100755
--- a/sssd-nightly.sh
+++ b/sssd-nightly.sh
@@ -13,16 +13,38 @@ function finish { #(exit code)
mkdir -p /local/sgallagh/logs
cd /local/sgallagh
+nextversion=$1
+if [ x$nextversion == x ]; then
+ nextversion=0.0.1
+fi
datestamp=`date +%Y%m%d%H`
+today=`date +%Y%m%d`
+git_repo=$2
+if [ x$git_repo == x ]; then
+ git_repo=git://git.fedorahosted.org/sssd.git
+fi
LOGFILE=/local/sgallagh/logs/nightly-$datestamp.log
+
echo "===== BUILD STARTED AT `date` =====" > $LOGFILE
+echo "===== Cleaning old RPMS =====" > $LOGFILE
+rm -f `find /local/sgallagh/repos/f11 -type f -daystart -ctime +6|grep sssd-` || finish 98
+rm -f `find /local/sgallagh/repos/rhel5 -type f -daystart -ctime +6|grep sssd-` || finish 99
+
echo "===== CHECKING OUT CODE =====" >> $LOGFILE
-git clone git://git.fedorahosted.org/sssd.git sssd-$datestamp >> $LOGFILE 2>&1
+rm -Rf sssd-$datestamp #Remove an incomplete previous run
+git clone $git_repo sssd-$datestamp >> $LOGFILE 2>&1
cd sssd-$datestamp
-echo $datestamp > VERSION
+
+commit_id=`git log -1 --pretty=format:%h`
+prereleaseversion=".${datestamp}git${commit_id}"
+echo $nextversion > VERSION
+echo $prereleaseversion >> VERSION
+rpmversion=$nextversion-0$prereleaseversion
+
mv contrib/sssd.spec.in contrib/sssd.spec.in.orig && \
sed -e "s/make %/make CFLAGS=\"-ggdb3 -O0\" %/" < contrib/sssd.spec.in.orig > contrib/sssd.spec.in
+
echo "===== CONFIGURING CODE =====" >> $LOGFILE
autoreconf -i -f >> $LOGFILE 2>&1 || finish 1
./configure >> $LOGFILE 2>&1 || finish 2
@@ -30,17 +52,17 @@ make srpms >> $LOGFILE 2>&1 || finish 3
cd rpmbuild/SRPMS
echo "===== BUILDING FEDORA 11 i586 =====" >> $LOGFILE
-mock -r fedora-11-i386 sssd-$datestamp-0.fc11.src.rpm >> $LOGFILE 2>&1 || finish 4
+mock -r fedora-11-i386 sssd-$rpmversion.fc11.src.rpm >> $LOGFILE 2>&1 || finish 4
echo "===== BUILDING FEDORA 11 x86_64 =====" >> $LOGFILE
-mock -r fedora-11-x86_64 sssd-$datestamp-0.fc11.src.rpm >> $LOGFILE 2>&1 || finish 5
+mock -r fedora-11-x86_64 sssd-$rpmversion.fc11.src.rpm >> $LOGFILE 2>&1 || finish 5
echo "===== CREATING FEDORA 11 i586 YUM REPOSITORY ====" >> $LOGFILE
mkdir -p /local/sgallagh/repos/f11/SRPMS
mkdir -p /local/sgallagh/repos/f11/i386/DEBUGINFO
mkdir -p /local/sgallagh/repos/f11/i386/RPMS
-cp /var/lib/mock/fedora-11-i386/result/sssd-$datestamp-0.fc11.src.rpm /local/sgallagh/repos/f11/SRPMS
-cp /var/lib/mock/fedora-11-i386/result/sssd-debuginfo-$datestamp-0.fc11.i586.rpm /local/sgallagh/repos/f11/i386/DEBUGINFO
-cp /var/lib/mock/fedora-11-i386/result/sssd-$datestamp-0.fc11.i586.rpm /local/sgallagh/repos/f11/i386/RPMS
+cp /var/lib/mock/fedora-11-i386/result/sssd-$rpmversion.fc11.src.rpm /local/sgallagh/repos/f11/SRPMS
+cp /var/lib/mock/fedora-11-i386/result/sssd-debuginfo-$rpmversion.fc11.i586.rpm /local/sgallagh/repos/f11/i386/DEBUGINFO
+cp /var/lib/mock/fedora-11-i386/result/sssd-$rpmversion.fc11.i586.rpm /local/sgallagh/repos/f11/i386/RPMS
createrepo /local/sgallagh/repos/f11/SRPMS
if [ $? -eq 0 ]; then
@@ -67,8 +89,8 @@ fi
echo "===== CREATING FEDORA 11 x86_64 YUM REPOSITORY ====" >> $LOGFILE
mkdir -p /local/sgallagh/repos/f11/x86_64/DEBUGINFO
mkdir -p /local/sgallagh/repos/f11/x86_64/RPMS
-cp /var/lib/mock/fedora-11-x86_64/result/sssd-debuginfo-$datestamp-0.fc11.x86_64.rpm /local/sgallagh/repos/f11/x86_64/DEBUGINFO
-cp /var/lib/mock/fedora-11-x86_64/result/sssd-$datestamp-0.fc11.x86_64.rpm /local/sgallagh/repos/f11/x86_64/RPMS
+cp /var/lib/mock/fedora-11-x86_64/result/sssd-debuginfo-$rpmversion.fc11.x86_64.rpm /local/sgallagh/repos/f11/x86_64/DEBUGINFO
+cp /var/lib/mock/fedora-11-x86_64/result/sssd-$rpmversion.fc11.x86_64.rpm /local/sgallagh/repos/f11/x86_64/RPMS
createrepo /local/sgallagh/repos/f11/x86_64/DEBUGINFO
if [ $? -eq 0 ]; then
@@ -86,21 +108,21 @@ fi
echo "===== BUILDING RHEL 5 i386 =====" >> $LOGFILE
cd /local/sgallagh/sssd-$datestamp/rpmbuild/SRPMS
-mv sssd-$datestamp-0.fc11.src.rpm \
- sssd-$datestamp-0.el5.src.rpm
-mock -r epel-5-i386 sssd-$datestamp-0.el5.src.rpm >> $LOGFILE 2>&1 || finish 6
+mv sssd-$rpmversion.fc11.src.rpm \
+ sssd-$rpmversion.el5.src.rpm
+mock -r epel-5-i386 sssd-$rpmversion.el5.src.rpm >> $LOGFILE 2>&1 || finish 6
echo "===== BUILDING RHEL 5 x86_64 =====" >> $LOGFILE
-mock -r epel-5-x86_64 sssd-$datestamp-0.el5.src.rpm >> $LOGFILE 2>&1 || finish 7
+mock -r epel-5-x86_64 sssd-$rpmversion.el5.src.rpm >> $LOGFILE 2>&1 || finish 7
echo "===== CREATING RHEL 5 i586 YUM REPOSITORY ====" >> $LOGFILE
mkdir -p /local/sgallagh/repos/rhel5/SRPMS
mkdir -p /local/sgallagh/repos/rhel5/i386/DEBUGINFO
mkdir -p /local/sgallagh/repos/rhel5/i386/RPMS
-cp /var/lib/mock/epel-5-i386/result/sssd-$datestamp-0.el5.src.rpm /local/sgallagh/repos/rhel5/SRPMS
-cp /var/lib/mock/epel-5-i386/result/sssd-debuginfo-$datestamp-0.el5.i386.rpm /local/sgallagh/repos/rhel5/i386/DEBUGINFO
-cp /var/lib/mock/epel-5-i386/result/sssd-$datestamp-0.el5.i386.rpm /local/sgallagh/repos/rhel5/i386/RPMS
+cp /var/lib/mock/epel-5-i386/result/sssd-$rpmversion.el5.src.rpm /local/sgallagh/repos/rhel5/SRPMS
+cp /var/lib/mock/epel-5-i386/result/sssd-debuginfo-$rpmversion.el5.i386.rpm /local/sgallagh/repos/rhel5/i386/DEBUGINFO
+cp /var/lib/mock/epel-5-i386/result/sssd-$rpmversion.el5.i386.rpm /local/sgallagh/repos/rhel5/i386/RPMS
createrepo -s sha1 /local/sgallagh/repos/rhel5/SRPMS
if [ $? -eq 0 ]; then
@@ -126,8 +148,8 @@ fi
echo "===== CREATING RHEL 5 x86_86 YUM REPOSITORY ====" >> $LOGFILE
mkdir -p /local/sgallagh/repos/rhel5/x86_64/DEBUGINFO
mkdir -p /local/sgallagh/repos/rhel5/x86_64/RPMS
-cp /var/lib/mock/epel-5-x86_64/result/sssd-debuginfo-$datestamp-0.el5.x86_64.rpm /local/sgallagh/repos/rhel5/x86_64/DEBUGINFO
-cp /var/lib/mock/epel-5-x86_64/result/sssd-$datestamp-0.el5.x86_64.rpm /local/sgallagh/repos/rhel5/x86_64/RPMS
+cp /var/lib/mock/epel-5-x86_64/result/sssd-debuginfo-$rpmversion.el5.x86_64.rpm /local/sgallagh/repos/rhel5/x86_64/DEBUGINFO
+cp /var/lib/mock/epel-5-x86_64/result/sssd-$rpmversion.el5.x86_64.rpm /local/sgallagh/repos/rhel5/x86_64/RPMS
createrepo -s sha1 /local/sgallagh/repos/rhel5/x86_64/DEBUGINFO
if [ $? -eq 0 ]; then