From 5b9b75ad33a25a12452d5898ebef7bedbf46f196 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 4 Mar 2008 18:10:05 +0000 Subject: [PATCH] Add daily build script example for the snapshot yum repository git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@663 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- buildcore.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ builddep.sh | 28 ++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100755 buildcore.sh create mode 100755 builddep.sh diff --git a/buildcore.sh b/buildcore.sh new file mode 100755 index 000000000..90b77de80 --- /dev/null +++ b/buildcore.sh @@ -0,0 +1,80 @@ +#!/bin/sh +cd `dirname $0` +GREP=grep +export DESTDIR=`pwd`/core-snap +export SRCDIR=`pwd`/core-snap-srpms +UPLOAD=0 +if [ "$1" == "UPLOAD" ]; then + UPLOAD=1 +fi +if [ -f /etc/redhat-release ] +then + pkg="redhat" +else + pkg="packages" +fi + +#rm -rf $DESTDIR +#rm -rf $SRCDIR +mkdir -p $DESTDIR +mkdir -p $SRCDIR +cd xcat-core +svn up > ../coresvnup +if $GREP xCAT-client ../coresvnup; then + UPLOAD=1 + ./makeclientrpm + rm -f $DESTDIR/xCAT-client*rpm + rm -f $SRCDIR/xCAT-client*rpm + mv /usr/src/$pkg/RPMS/noarch/xCAT-client-2.0*rpm $DESTDIR/ + mv /usr/src/$pkg/SRPMS/xCAT-client-2.0*rpm $SRCDIR/ +fi +if $GREP perl-xCAT ../coresvnup; then + UPLOAD=1 + ./makeperlxcatrpm + rm -f $DESTDIR/perl-xCAT*rpm + rm -f $SRCDIR/perl-xCAT*rpm + mv /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.0*rpm $DESTDIR/ + mv /usr/src/$pkg/SRPMS/perl-xCAT-2.0*rpm $SRCDIR/ +fi +if $GREP xCAT-server ../coresvnup; then + UPLOAD=1 + ./makeserverrpm + rm -f $DESTDIR/xCAT-server*rpm + rm -f $SRCDIR/xCAT-server*rpm + mv /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm $DESTDIR + mv /usr/src/$pkg/SRPMS/xCAT-server-2.0*rpm $SRCDIR +fi +if $GREP xCAT-nbroot ../coresvnup; then + UPLOAD=1 + cd xCAT-nbroot + ./mkrpm x86_64 + ./mkrpm ppc64 + rm -f $DESTDIR/xCAT-nbroot-core*rpm + rm -f $SRCDIR/xCAT-nbroot-core*rpm + mv /usr/src/$pkg/RPMS/noarch/xCAT-nbroot-core-*rpm $DESTDIR + mv /usr/src/$pkg/SRPMS/xCAT-nbroot-core-*rpm $SRCDIR + cd .. +fi +if $GREP "U xCAT/" ../coresvnup; then + UPLOAD=1 + cd xCAT + ./mkrpm + rm -f $DESTDIR/xCAT-2.0*rpm + rm -f $SRCDIR/xCAT-2.0*rpm + mv /usr/src/$pkg/RPMS/*/xCAT-2*rpm $DESTDIR + mv /usr/src/$pkg/SRPMS/xCAT-2*rpm $SRCDIR + cd .. +fi +if [ $UPLOAD == 0 ]; then + echo "Nothing new detected" + exit 0; +fi +createrepo $DESTDIR +createrepo $SRCDIR +cd $DESTDIR/.. +export CFNAME=core-rpms-snap.`date +%Y.%m.%d`.tar.bz2 +export DFNAME=dep-rpms-snap.`date +%Y.%m.%d`.tar.bz2 +tar jcvf $CFNAME core-snap +#tar jcvf $DFNAME dep-snap +scp $CFNAME jbjohnso@shell1.sf.net:/home/groups/x/xc/xcat/htdocs/yum/ +ssh jbjohnso@shell1.sf.net "cd /home/groups/x/xc/xcat/htdocs/yum/; rm -rf core-snap; tar jxvf $CFNAME" diff --git a/builddep.sh b/builddep.sh new file mode 100755 index 000000000..9837b8ff7 --- /dev/null +++ b/builddep.sh @@ -0,0 +1,28 @@ +#!/bin/sh +cd `dirname $0` +GREP=grep +export DESTDIR=`pwd`/dep-snap +export SRCDIR=`pwd`/dep-snap-srpms +UPLOAD=0 +if [ "$1" == "UPLOAD" ]; then + UPLOAD=1 +fi +if [ -f /etc/redhat-release ] +then + pkg="redhat" +else + pkg="packages" +fi + +#rm -rf $DESTDIR +#rm -rf $SRCDIR +if [ $UPLOAD == 0 ]; then + echo "Nothing new detected" + exit 0; +fi +createrepo $DESTDIR +cd $DESTDIR/.. +export DFNAME=dep-rpms-snap.`date +%Y.%m.%d`.tar.bz2 +tar jcvf $DFNAME dep-snap +scp $DFNAME jbjohnso@shell1.sf.net:/home/groups/x/xc/xcat/htdocs/yum/ +ssh jbjohnso@shell1.sf.net "cd /home/groups/x/xc/xcat/htdocs/yum/; rm -rf dep-snap; tar jxvf $DFNAME"