Initial Commit
This commit is contained in:
56
startAcademyEnvironment
Executable file
56
startAcademyEnvironment
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
use threads;
|
||||
use 5.010;
|
||||
use Getopt::Long qw(GetOptions);
|
||||
|
||||
my $instanceCount;
|
||||
my $adminEnv;
|
||||
my $offset;
|
||||
my $destroy = '';
|
||||
|
||||
|
||||
|
||||
GetOptions('instances=s' => \$instanceCount,
|
||||
'admin=s' => \$adminEnv,
|
||||
'offset=i' => \$offset,
|
||||
'destroy' => \$destroy);
|
||||
|
||||
|
||||
# check parameters
|
||||
if (!(defined $instanceCount && length $instanceCount > 0)) { usage(); }
|
||||
if (!(defined $offset)) {
|
||||
print "No Offset specified; Setting Offset to 0\n";
|
||||
$offset = 0;
|
||||
}
|
||||
if (!(defined $adminEnv && length $adminEnv > 0)) { usage(); }
|
||||
if ($adminEnv != "1") { $adminEnv = 0 }
|
||||
|
||||
my $startArgs = "";
|
||||
if ($adminEnv) {
|
||||
$startArgs = "--brokenAppLink --brokenBaseURL";
|
||||
}
|
||||
if ($destroy) {
|
||||
$startArgs = "$startArgs --destroy";
|
||||
}
|
||||
|
||||
|
||||
my @threads;
|
||||
# start as many instances as specified
|
||||
for (my $i=$offset; $i<$instanceCount+$offset; $i++)
|
||||
{
|
||||
push @threads, async {system ("./setupAcademyInstancev2.pl -instance $i $startArgs")};
|
||||
}
|
||||
|
||||
for (@threads) {
|
||||
$_->join();
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
sub usage
|
||||
{
|
||||
print "Usage: $0 --instances INSTANCECOUNT --admin [0|1]\n";
|
||||
exit 1;
|
||||
}
|
||||
Reference in New Issue
Block a user