From: Edward Z. Yang Date: Sun, 10 Jan 2010 08:00:25 +0000 (-0500) Subject: Add some utility scripts, based off of documentation. X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/commitdiff_plain/ce21e13053c6d52a5bf33bb47ee91c230ecb8018 Add some utility scripts, based off of documentation. Signed-off-by: Edward Z. Yang --- diff --git a/bin/prepare-retro-upgrade b/bin/prepare-retro-upgrade new file mode 100755 index 0000000..eaa9e62 --- /dev/null +++ b/bin/prepare-retro-upgrade @@ -0,0 +1,43 @@ +#!/bin/bash +set -xe + +APP="$1" +VERSION="$2" +PRIOR="$3" +APPLICATION="$4" + +if [ -z "$APPLICATION" ]; then + echo "$0 APP VERSION PRIOR-VERSION APPLICATION" + echo + echo "Prepares a retroactive upgrade on a repository. Be" + echo "sure to run tests/prepare-upgrade.sh on the resulting" + echo "commits on a scripts server." + echo + echo " APP : short name, like 'wordpress'" + echo " VERSION : version being retro'd" + echo " PRIOR-VERSION : version to retro on to" + echo " APPLICATION : full name of application for commit message" + echo + echo "See docs/upgrade.rst " + echo "for detailed instructions." + exit 1 +fi + +git checkout -b tmaster || git checkout tmaster +git reset --hard $APP-$PRIOR-scripts +git checkout -b tpristine || git checkout tpristine +git reset --hard $APP-$PRIOR + +DATE=`git show HEAD --format="format:%cd" | head -n1` + +export GIT_AUTHOR_DATE="$DATE" +export GIT_COMMITTER_DATE="$DATE" + +wizard prepare-pristine $APP-$VERSION --force +git commit -asm "$APPLICATION $VERSION" +git tag $APP-$VERSION + +git checkout tmaster +git merge tpristine --no-commit || bash || true +git commit -asm "$APPLICATION $VERSION-scripts" +git tag $APP-$VERSION-scripts diff --git a/tests/prepare-upgrade.sh b/tests/prepare-upgrade.sh new file mode 100755 index 0000000..1e028f9 --- /dev/null +++ b/tests/prepare-upgrade.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +APP="$1" +VERSION="$2" + +if [ -z "$VERSION" ]; then + echo "Usage: $0 APP VERSION" + echo + echo "For preparing a special test copy of an application with" + echo "Any new configuration changes." + echo + echo "See docs/upgrade.rst " + echo "for detailed usage instructions." + exit 1 +fi + +env WIZARD_NO_COMMIT=1 ./$APP-install-test.sh $VERSION +cd testdir_${APP}_install_${VERSION} +wizard prepare-config +echo "Diff:" +git diff