From 31e160f6b9d93f23004e43982cb617f2fc9aeaeb Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 5 Mar 2012 16:36:28 -0800 Subject: [PATCH] update dev-server and dev-blobserver (but dev-blobserver still broken on start-up) Change-Id: I327cf8d2ec8c4a9c563df28ca76c75a75b62e21c --- dev-blobserver | 13 ++++++++++--- dev-server | 9 +++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dev-blobserver b/dev-blobserver index 0b66c591d..d393c97f1 100755 --- a/dev-blobserver +++ b/dev-blobserver @@ -8,6 +8,8 @@ sub usage { die "Usage: dev-blobserver [--wipe] [--tls] -- [other_blobserver_opts]"; } +chdir $Bin or die; + my $opt_wipe; my $opt_tls; GetOptions( @@ -19,9 +21,13 @@ my $port = shift; $port = "3179" unless defined($port); usage() unless $port =~ /^\d+$/; -system("./build.pl", "server/go/camlistored") and die "Failed to build.\n"; +unless ($ENV{GOPATH}) { + $ENV{GOPATH} = "$Bin/gopath" +} -my $root = "/tmp/camliroot/port$port/"; +system("go", "install", "./server/camlistored") and die "Failed to build camlistored"; + +my $root = "/tmp/camliroot-$ENV{USER}/port$port/"; if ($opt_wipe && -d $root) { print "Wiping $root\n"; system("rm", "-rf", $root) and die "Failed to wipe $root.\n"; @@ -37,8 +43,9 @@ $ENV{CAMLI_PORT} = $port; $ENV{CAMLI_ROOT} = $root; $ENV{CAMLI_TLS_CRT_FILE} = $opt_tls ? "$Bin/config/dev-tls.crt" : ""; $ENV{CAMLI_TLS_KEY_FILE} = $opt_tls ? "$Bin/config/dev-tls.key" : ""; -exec("$FindBin::Bin/server/go/camlistored/camlistored", +exec("$ENV{GOPATH}/bin/camlistored", "-configfile=$Bin/config/dev-blobserver-config.json", "-listen=127.0.0.1:$port", @ARGV); +die "exec failure: $!\n"; diff --git a/dev-server b/dev-server index 534708af1..0a65bcff2 100755 --- a/dev-server +++ b/dev-server @@ -39,8 +39,12 @@ my $port = shift; $port = "3179" unless defined($port); usage() unless $port =~ /^\d+$/; +unless ($ENV{GOPATH}) { + $ENV{GOPATH} = "$Bin/gopath" +} + unless ($opt_nobuild) { - system("go", "build", "-o", "./gopath/bin/camlistored", "./server/camlistored") and die "Failed to build camlistored"; + system("go", "install", "./server/camlistored") and die "Failed to build camlistored"; # TODO-GO1: FIX: system("./build.pl", "clients/go/camdbinit") and die "Failed to build camdbinit"; } @@ -131,7 +135,8 @@ unless ($opt_staticres) { $ENV{CAMLI_DEV_UI_FILES} = "$FindBin::Bin/server/camlistored/ui"; # set in server/camlistored/ui/fileembed.go } -exec("./gopath/bin/camlistored", +exec("$ENV{GOPATH}/bin/camlistored", "-configfile=$Bin/config/dev-server-config.json", "-listen=$listen", @ARGV); +die "exec failure: $!\n";