From bd8004ab28c78beaccd1fa947981fb783c058570 Mon Sep 17 00:00:00 2001 From: Lukas Berk Date: Wed, 24 Oct 2012 12:08:22 -0400 Subject: [PATCH] Add spin-rawhide script for automated rawhide releases * scripts/spin-rawhide: freshly clones systemtap.git and fedpkg git repositories, update the .spec file accordingly and submit new build to bodhi --- scripts/spin-rawhide | 65 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 scripts/spin-rawhide diff --git a/scripts/spin-rawhide b/scripts/spin-rawhide new file mode 100755 index 000000000..6ef8a505f --- /dev/null +++ b/scripts/spin-rawhide @@ -0,0 +1,65 @@ +#!/usr/bin/bash + +### Constants ### +HASH=`mkpasswd -l 6 -s 0` +DATE=`date | cut -f1,2,3,6 -d" "` +NAME=`git config --get-all user.name` +EMAIL=`git config --get-all user.email` +STAP_MAJOR_VERSION=`grep "Version:" systemtap.spec` +CHANGELOG_VERSION=`echo $STAP_MAJOR_VERSION | cut -f2 -d" "` +GIT_VERSION_TAG=`echo 0.$(git describe | rev | cut -f1,2 -d- --output-delimiter=. | rev)` +STAP_DIR=/tmp/systemtap$HASH +FEDSCM_DIR=/tmp/fedora-scm$HASH/ +FEDSCM_STAP_DIR=$FEDSCM_DIR/systemtap + +### lets do some sanity checks first +if [ -z "$STAP_DIR" ]; then +echo "Please set your systemtap directory variable (STAP_DIR)" +exit +fi + +if [ -z "$FEDSCM_STAP_DIR" ]; then +echo "Please set your fedora-scm directory variable (FEDSCM_STAP_DIR)" +echo "This is the directory used for fedora releases" +exit +fi + +if which fedpkg &>/dev/null; then + : +else +echo "Please install the fedpkg package" +exit +fi + +#Create the needed directories +cd /tmp + +#Use the hash at the end to relatively ensure uniquness +git clone git://sourceware.org/git/systemtap.git systemtap$HASH + +mkdir -p $FEDSCM_DIR +cd $FEDSCM_DIR +fedpkg co systemtap + +cd $STAP_DIR +git archive --prefix=systemtap-$CHANGELOG_VERSION/ -o $FEDSCM_STAP_DIR/systemtap-$CHANGELOG_VERSION-$GIT_VERSION_TAG.tar.gz HEAD + +### fedpackage stuff + +cd $FEDSCM_STAP_DIR + +sed -i "s/Release: .*/Release: $GIT_VERSION_TAG\%\{\?dist\}/" systemtap.spec +sed -i "s/Source:.*/Source: %{name}-%{version}-$GIT_VERSION_TAG.tar.gz/" systemtap.spec +sed -i "s/\%changelog/\%changelog\n* $DATE $NAME <$EMAIL> - $CHANGELOG_VERSION-$GIT_VERSION_TAG\n- Automated weekly rawhide release\n/" systemtap.spec + +echo "Please ensure that you have an up to date fedoraproject SSL certificate, you can achieve this by running fedora-cert -n" + +fedpkg new-sources systemtap-$CHANGELOG_VERSION-$GIT_VERSION_TAG.tar.gz + +fedpkg commit -m "Automated weekly systemtap rawhide release: $GIT_VERSION_TAG" -p + +fedpkg build + +# cleanup +rm -rf $STAP_DIR +rm -rf $FEDSCM_DIR -- 2.43.5