| 227 |
dpurdie |
1 |
#!/usr/local/bin/perl -w
|
|
|
2 |
|
|
|
3 |
use LWP::UserAgent;
|
|
|
4 |
use DeployUtils::Logger;
|
|
|
5 |
use DeployUtils::RmPkgInfo;
|
|
|
6 |
use JatsEnv;
|
|
|
7 |
|
|
|
8 |
if ( $#ARGV != 2 )
|
|
|
9 |
{
|
|
|
10 |
printf("Error: Must supply Platform, Package Name & Pkg Version\n");
|
|
|
11 |
exit 1;
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
my $Platform = $ARGV[0];
|
|
|
15 |
my $PkgName = $ARGV[1];
|
|
|
16 |
my $PkgVersion = $ARGV[2];
|
|
|
17 |
|
|
|
18 |
my $PkgReleaseNote = "$PkgName-$PkgVersion-$Platform";
|
|
|
19 |
|
|
|
20 |
LogNorm("Retrieving Release Manager Details...Please wait...");
|
|
|
21 |
my $RmPkgDetails = DeployUtils::RmPkgInfo->new(
|
|
|
22 |
{ PKG_NAME => $PkgName,
|
|
|
23 |
PKG_VERSION => $PkgVersion } );
|
|
|
24 |
|
|
|
25 |
# our package does not exist in release manager
|
|
|
26 |
LogError("Package $PkgName $PkgVersion does not exist in the Release Manager. Please check configuration.")
|
|
|
27 |
if ( ! $RmPkgDetails->foundPkg() );
|
|
|
28 |
|
|
|
29 |
our $GBE_RM_URL;
|
|
|
30 |
EnvImport('GBE_RM_URL');
|
|
|
31 |
|
|
|
32 |
LogNorm("Retrieving Release Notes From Release Manager...Please wait...");
|
|
|
33 |
|
|
|
34 |
my $user_agent = LWP::UserAgent->new( timeout => 30 );
|
|
|
35 |
my $response = $user_agent->get($GBE_RM_URL . '/_adhoc_release_notes.asp?pv_id='. $RmPkgDetails->pv_id(),
|
|
|
36 |
':content_file' => "$PkgReleaseNote\.html");
|
|
|
37 |
if ( $response->is_success )
|
|
|
38 |
{
|
|
|
39 |
LogNorm("Retrieved Release Manager HTML Release note [$PkgReleaseNote\.html]");
|
|
|
40 |
exit 0;
|
|
|
41 |
}
|
|
|
42 |
else
|
|
|
43 |
{
|
|
|
44 |
LogWarn("Unable to retrieve Release Manager Release Notes for pv_id [" . $RmPkgDetails->pv_id() . "]");
|
|
|
45 |
print $response->error_as_HTML;
|
|
|
46 |
exit 1;
|
|
|
47 |
}
|
|
|
48 |
|