summaryrefslogtreecommitdiff
path: root/contrib/mw-to-git/t/install-wiki.sh
diff options
context:
space:
mode:
authorGuillaume Sasdy <guillaume.sasdy@ensimag.imag.fr>2012-07-06 10:03:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-06 19:20:45 (GMT)
commit5ef6ad178521d146ccef84c8f4d2993d5c77c7e6 (patch)
treedc221cd425cf35f6aa29e265d194adefc78f077d /contrib/mw-to-git/t/install-wiki.sh
parent6df7e0df0912fe88862287bf9871c50dafe722e6 (diff)
downloadgit-5ef6ad178521d146ccef84c8f4d2993d5c77c7e6.zip
git-5ef6ad178521d146ccef84c8f4d2993d5c77c7e6.tar.gz
git-5ef6ad178521d146ccef84c8f4d2993d5c77c7e6.tar.bz2
git-remote-mediawiki: scripts to install, delete and clear a MediaWiki
install_wiki.sh allows the user to install a MediaWiki instance in a single shell command. Like "git instaweb", it configures and launches lighttpd without requiring root priviledges. To simplify database management, it uses SQLite, which doesn't require a running daemon, and allows reseting the database by simply replacing a single file. This allows install_wiki to also defines a function wiki_reset which clear all content of the previously created wiki, which will be very useful to run several indepenant tests on the same wiki. Note those functionnalities are made to be used from the user command line in the directory git/contrib/mw-to-git/t/ Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr> Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr> Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr> Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr> Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/mw-to-git/t/install-wiki.sh')
-rwxr-xr-xcontrib/mw-to-git/t/install-wiki.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/contrib/mw-to-git/t/install-wiki.sh b/contrib/mw-to-git/t/install-wiki.sh
new file mode 100755
index 0000000..c6d6fa3
--- /dev/null
+++ b/contrib/mw-to-git/t/install-wiki.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# This script installs or deletes a MediaWiki on your computer.
+# It requires a web server with PHP and SQLite running. In addition, if you
+# do not have MediaWiki sources on your computer, the option 'install'
+# downloads them for you.
+# Please set the CONFIGURATION VARIABLES in ./test-gitmw-lib.sh
+
+WIKI_TEST_DIR=$(cd "$(dirname "$0")" && pwd)
+
+if test -z "$WIKI_TEST_DIR"
+then
+ WIKI_TEST_DIR=.
+fi
+
+. "$WIKI_TEST_DIR"/test-gitmw-lib.sh
+usage () {
+ echo "Usage: "
+ echo " ./install-wiki.sh <install | delete | --help>"
+ echo " install | -i : Install a wiki on your computer."
+ echo " delete | -d : Delete the wiki and all its pages and "
+ echo " content."
+}
+
+
+# Argument: install, delete, --help | -h
+case "$1" in
+ "install" | "-i")
+ wiki_install
+ exit 0
+ ;;
+ "delete" | "-d")
+ wiki_delete
+ exit 0
+ ;;
+ "--help" | "-h")
+ usage
+ exit 0
+ ;;
+ *)
+ echo "Invalid argument: $1"
+ usage
+ exit 1
+ ;;
+esac