mkrelease: add a --runtests shortcut
authorMike Frysinger <vapier@gentoo.org>
Sun, 5 Jan 2014 15:50:34 +0000 (10:50 -0500)
committerBrian Dolbec <dolsen@gentoo.org>
Sun, 5 Jan 2014 23:15:41 +0000 (15:15 -0800)
This automates the release+test cycle a bit so people don't have to do
it all by hand.

DEVELOPING
mkrelease.sh

index 7aac81b7d34a362c5c362827d33a113c2f97378d..b704a50fb92c77226a11eaea8e7dd08b80216e3e 100644 (file)
@@ -167,11 +167,8 @@ Releases
 First create a git tag for this release:
        git tag v2.2.8
 
-Then create the tarball:
-       ./mkrelease.sh --changelog-rev v2.2.7 --tag 2.2.8
-
-Unpack the tarball and run tests:
-       ./runtests.sh --python-versions=supported
+Then create the tarball and run the tests:
+       ./mkrelease.sh --changelog-rev v2.2.7 --tag --runtests 2.2.8
 Make sure you have all supported python versions installed first
 (see PYTHON_SUPPORTED_VERSIONS in runtests.sh).
 
index 50bdb3cd04257552aed152fd173e7646459aa156..334b4fb48eacc99f431853485e54fcde0bb9a2d7 100755 (executable)
@@ -8,9 +8,10 @@ BRANCH=${BRANCH:-master}
 USE_TAG=false
 CHANGELOG_REVISION=
 UPLOAD_LOCATION=
+RUNTESTS=false
 
 usage() {
-       echo "Usage: ${0##*/} [--changelog-rev <tree-ish>] [-t|--tag] [-u|--upload <location>] <version>"
+       echo "Usage: ${0##*/} [--changelog-rev <tree-ish>] [-t|--tag] [-u|--upload <location>] [--runtests] <version>"
        exit ${1:-0}
 }
 
@@ -19,7 +20,7 @@ die() {
        usage 1
 }
 
-ARGS=$(getopt -o htu: --long help,changelog-rev:,tag,upload: \
+ARGS=$(getopt -o htu: --long help,changelog-rev:,runtests,tag,upload: \
        -n "${0##*/}" -- "$@")
 [ $? != 0 ] && die "initialization error"
 
@@ -42,6 +43,10 @@ while true; do
                -h|--help)
                        usage
                        ;;
+               --runtests)
+                       RUNTESTS=true
+                       shift
+                       ;;
                --)
                        shift
                        break
@@ -78,6 +83,12 @@ cp -a "${SOURCE_DIR}/"{bin,cnf,doc,man,misc,pym} "${RELEASE_DIR}/" || die "direc
 cp "${SOURCE_DIR}/"{DEVELOPING,LICENSE,Makefile,NEWS,README,RELEASE-NOTES,TEST-NOTES} \
        "${RELEASE_DIR}/" || die "file copy failed"
 
+if [[ ${RUNTESTS} == "true" ]] ; then
+       pushd "${SOURCE_DIR}" >/dev/null
+       ./runtests.sh --python-versions=supported || die "tests failed"
+       popd >/dev/null
+fi
+
 rm -rf "${SOURCE_DIR}" || die "directory cleanup failed"
 
 echo ">>> Setting portage.VERSION"