aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/perl
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahoo-inc.com>2017-06-06 14:52:14 +0200
committerHåkon Hallingstad <hakon@yahoo-inc.com>2017-06-06 14:52:14 +0200
commit8472caf97dd558d6f0ac3d4310e1eb6ca4264495 (patch)
tree45a05be7082652f439998ecddb5491b0bfbe775b /config-model/src/main/perl
parentef89ead652b55d7742767aea7e9c3d9243f19336 (diff)
Support deploying to specific config server
Diffstat (limited to 'config-model/src/main/perl')
-rwxr-xr-xconfig-model/src/main/perl/deploy17
1 files changed, 14 insertions, 3 deletions
diff --git a/config-model/src/main/perl/deploy b/config-model/src/main/perl/deploy
index 6c165951ab0..8ddc948c3f2 100755
--- a/config-model/src/main/perl/deploy
+++ b/config-model/src/main/perl/deploy
@@ -72,7 +72,7 @@ readConfFile();
use strict;
use warnings;
use feature qw(switch say);
-use vars qw/ $opt_h $opt_n $opt_v $opt_f $opt_t $opt_1 $opt_a $opt_e $opt_E $opt_r $opt_i $opt_p $opt_H $opt_R /;
+use vars qw/ $opt_c $opt_h $opt_n $opt_v $opt_f $opt_t $opt_1 $opt_a $opt_e $opt_E $opt_r $opt_i $opt_p $opt_H $opt_R /;
use Env qw($HOME);
use JSON;
use Getopt::Std;
@@ -99,15 +99,20 @@ my $environment = "prod";
my $region = "default";
my $instance = "default";
my $version = "v2";
+my $configserver = "";
my $port = "19071";
-getopts('fhnt:v1e:E:r:a:i:p:HR:');
+getopts('c:fhnt:v1e:E:r:a:i:p:HR:');
if ($opt_h) {
usage();
exit 0;
}
+if ($opt_c) {
+ $configserver = $opt_c;
+}
+
if ($opt_e) {
$tenant = $opt_e;
}
@@ -303,7 +308,13 @@ sub fetch_directory {
sub get_configsource_url {
my ($command) = @_;
- my @configsources = split(' ', `$VESPA_HOME/bin/vespa-print-default configservers_http`);
+ my @configsources;
+ if ($configserver and $configserver ne "") {
+ @configsources = ('http://' . $configserver . ':' . $port . '/');
+ } else {
+ @configsources = split(' ', `$VESPA_HOME/bin/vespa-print-default configservers_http`);
+ }
+
my $configsource_url = shift(@configsources);
if (!$configsource_url) {
die "Could not get url to config server, make sure that VESPA_HOME and services.addr_configserver is set\n";