forked from perkeep/perkeep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev-indexer
executable file
·43 lines (34 loc) · 1.04 KB
/
dev-indexer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl
use strict;
use FindBin qw($Bin);
use Getopt::Long;
sub usage {
die "Usage: dev-indexer [--wipe] <portnumber> -- [other_blobserver_opts]";
}
my $opt_wipe;
GetOptions("wipe" => \$opt_wipe)
or usage();
my $port = shift || "3200";
usage() unless $port =~ /^\d+$/;
system("./build.pl", "server/go/camlistored") and die "Failed to build camlistored";
system("./build.pl", "clients/go/camdbinit") and die "Failed to build camdbinit";
my $DBNAME = "devcamlistore";
my @opts;
if ($opt_wipe) {
push @opts, "-wipe";
} else {
push @opts, "-ignoreexists";
}
system("./clients/go/camdbinit/camdbinit",
"-user=root",
"-password=root",
"-host=localhost",
"-database=$DBNAME",
@opts) and die "Failed to run camdbinit.\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",
"-configfile=$Bin/config/dev-indexer-config.json",
"-listen=:$port",
@ARGV);