Fix dev-indexer; make it use a config file.

This commit is contained in:
Brad Fitzpatrick 2011-05-01 16:23:58 -07:00
parent 12b8190828
commit 9f486934f5
2 changed files with 22 additions and 4 deletions

View File

@ -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"
}
}
}
}

View File

@ -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);