From 9f486934f5e0789b3b6913523fab8b7deea36c63 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sun, 1 May 2011 16:23:58 -0700 Subject: [PATCH] Fix dev-indexer; make it use a config file. --- config/dev-indexer-config.json | 17 +++++++++++++++++ dev-indexer | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 config/dev-indexer-config.json diff --git a/config/dev-indexer-config.json b/config/dev-indexer-config.json new file mode 100644 index 000000000..5adc98af9 --- /dev/null +++ b/config/dev-indexer-config.json @@ -0,0 +1,17 @@ +{ "_for-emacs": "-*- mode: js2;-*-", + "baseURL": ["_env", "http://localhost:${CAMLI_PORT}"], + "password": ["_env", "${CAMLI_PASSWORD}"], + "prefixes": { + "/indexer/": { + "handler": "mysqlindexer", + "handlerArgs": { + "database": "devcamlistore", + "user": "root", + "password": "root", + "host": "127.0.0.1" + } + } + } +} + + diff --git a/dev-indexer b/dev-indexer index 0d99f81f8..a31e6bbf3 100755 --- a/dev-indexer +++ b/dev-indexer @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict; -use FindBin; +use FindBin qw($Bin); use Getopt::Long; use DBI; @@ -28,6 +28,7 @@ unless (-d $root) { system("mkdir", "-p", $root) and die "Failed to create $root.\n"; } + my $DBNAME = "devcamlistore"; my $dbh = DBI->connect("DBI:mysql:database=mysql", "root", "root") or @@ -78,11 +79,11 @@ if ($opt_wipe) { ")"); } -print "Starting indexer with indexer on http://localhost:$port/ in $root\n"; +print "Starting indexer with indexer on http://localhost:$port/indexer/\n"; $ENV{CAMLI_PASSWORD} = "pass$port"; +$ENV{CAMLI_PORT} = $port; exec("$FindBin::Bin/server/go/camlistored/camlistored", - "-root=$root", # NOTE: Root required but not used by indexer blobserver + "-configfile=$Bin/config/dev-indexer-config.json", "-listen=:$port", - "-devmysqlindexer", @ARGV);