]> scripts.mit.edu Git - wizard.git/commitdiff
Add some utility scripts, based off of documentation.
authorEdward Z. Yang <ezyang@mit.edu>
Sun, 10 Jan 2010 08:00:25 +0000 (03:00 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Sun, 10 Jan 2010 08:11:04 +0000 (03:11 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
bin/prepare-retro-upgrade [new file with mode: 0755]
tests/prepare-upgrade.sh [new file with mode: 0755]

diff --git a/bin/prepare-retro-upgrade b/bin/prepare-retro-upgrade
new file mode 100755 (executable)
index 0000000..eaa9e62
--- /dev/null
@@ -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 <http://scripts.mit.edu/wizard/upgrade.html>"
+    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 (executable)
index 0000000..1e028f9
--- /dev/null
@@ -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 <http://scripts.mit.edu/wizard/upgrade.html>"
+    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