-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdumpApiCommonQaWdkMetaBatches
More file actions
executable file
·56 lines (39 loc) · 1.89 KB
/
dumpApiCommonQaWdkMetaBatches
File metadata and controls
executable file
·56 lines (39 loc) · 1.89 KB
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
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl
use strict;
my ($targetDir, $buildNum) = @ARGV;
my %projectsMap = ('AmoebaDB', 'amoeba', 'CryptoDB', 'cryptodb',
'FungiDB', 'fungidb', 'GiardiaDB', 'giardiadb',
'HostDB', 'hostdb', 'MicrosporidiaDB', 'micro',
'PiroplasmaDB', 'piro', 'PlasmoDB', 'plasmo',
'SchistoDB', 'schisto', 'ToxoDB', 'toxo', 'TrichDB', 'trichdb',
'TriTrypDB', 'tritrypdb', 'VectorBase', 'vectorbase');
die "
Dump WDK meta information (eg Searches) into solr-compatible json files. Reads the web services
from QA sites for all the genomics components.
(This program is deprecated, in favor of a jenkins job associated with a site build, that performs the same function.)
(The program has a hard-coded list of genomics components. It uses that and the provided buildNum to form the URL
for each QA site. It calls ssCreateWdkMetaBatch for each one.)
Usage: dumpQaWdkMetaBaches targetDir buildNum
" unless $targetDir && $buildNum;
die "targetDir '$targetDir' does not exist or is not a directory\n" unless -d $targetDir;
my $BATCH_DIR_PREFIX = "solr-json-batch";
foreach my $project (keys %projectsMap) {
my $dom = $project eq 'SchistoDB'? 'net' : 'org';
my $abbrev = $projectsMap{$project};
my @temp = glob("$targetDir/${BATCH_DIR_PREFIX}_wdkmeta_${project}*");
my $serviceUrl = "'https://qa.${project}.${dom}/${abbrev}.b${buildNum}/service'";
runCmd("ssCreateWdkMetaBatch $serviceUrl $project $targetDir")
unless checkPrevBatchDir($temp[0], "wdkmeta", $project);
}
sub checkPrevBatchDir {
my ($prevBatchDir, $batchType, $batchName) = @_;
return 0 unless -e $prevBatchDir;
die "\nError: Incomplete batch dir (no DONE file): $prevBatchDir. Please delete it first.\n" unless -e "$prevBatchDir/DONE";
print STDOUT "Batch '$batchType $batchName' already present in targetDir. Skipping.\n";
return 1;
}
sub runCmd {
my ($cmd) = @_;
print STDOUT "Running $cmd\n";
system($cmd) && die "Failed\n";
}