diff options
author | 2008-09-17 20:23:28 +0530 | |
---|---|---|
committer | 2008-09-17 20:28:02 +0530 | |
commit | 5c027f6013d58618c1f9e46f12c34bf44c517bcc (patch) | |
tree | 7a6a1b0114a805ad6e8bdddf758d6de04ccd2f9e | |
parent | Add an ebuild for the 0.0.1 release of autotua (diff) | |
download | autotua-5c027f6013d58618c1f9e46f12c34bf44c517bcc.tar.gz autotua-5c027f6013d58618c1f9e46f12c34bf44c517bcc.tar.bz2 autotua-5c027f6013d58618c1f9e46f12c34bf44c517bcc.zip |
Add a script to do releases
-rwxr-xr-x | scripts/do-release.sh | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/scripts/do-release.sh b/scripts/do-release.sh new file mode 100755 index 0000000..c1cf5a2 --- /dev/null +++ b/scripts/do-release.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -e + +V="${1}" +RDIR='/home/nirbheek/projects/AutotuA/releases' +REPO='/home/nirbheek/projects/AutotuA/autotua.git' +TMPDIR='/tmp/autotua-release' +DESTDIR="${RDIR}/${V}" +REMOTE="bheekling@dev.gentooexperimental.org:~/public_html/files/autotua/" + +test -z ${V} && echo "Specify version plz, kthx." && exit 1 + +rm -rf "${TMPDIR}" +mkdir "${TMPDIR}" +test -d "${DESTDIR}" || mkdir "${DESTDIR}" + +confirm_overwrite() { + if test -e "${DESTDIR}/${FILE}"; then + echo -n "A tarball for that release already exists. Overwrite? [y/N] " + read ans + if test "${ans}" != "y"; then + echo "Cancelled." + exit 0 + fi + fi +} + +release_master() { + P="autotua-master-${V}" + FILE="${P}.tar.gz" + confirm_overwrite + cd "${REPO}/master" + git archive --prefix=${P}/ HEAD * | gzip -9 > "${DESTDIR}/${FILE}" +} + +release_slave() { + P="autotua-slave-${V}" + FILE="${P}.tar.gz" + confirm_overwrite + cd "${REPO}/slave" + git archive --prefix=${P}/ HEAD * | tar x -C "${TMPDIR}" + cd "${TMPDIR}/${P}" + ./setup.py --quiet sdist + cp "dist/${FILE}" "${DESTDIR}" + rm -rf "${TMPDIR}/${P}" +} + +upload_archives() { + scp -r "${DESTDIR}" "${REMOTE}" +} + +bumb_ebuild() { + CATEG='dev-util' + PN='autotua-slave' + P="${PN}-${V}" + cd "${REPO}/overlay/${CATEG}/${PN}" + test -f ${P}.ebuild || mv $(echo ${PN}-*.ebuild | line ) ${P}.ebuild + sed -i -e "/${P}.tar.gz/d" Manifest + rm -f "/usr/portage/distfiles/${P}.tar.gz" + ebuild ${P}.ebuild digest +} + +release_slave +release_master +upload_archives +bumb_ebuild |