Comskil-JIRA
view release on metacpan or search on metacpan
bin/jmerge.pl view on Meta::CPAN
#!perl
# File: jmerge.pl
# Desc: A program that examines a local JIRA backup file and then interogates
# remote JIRA instances for data to be combined into a new backup file
# in preparation of a project restore in order to import and integrate
# the data from the remote system into a controlled instance.
#
# TODO Add in Perl documentations for the comman-line tool.
# TODO Flow down some of the options into the JWand object such as:
# TODO --verbose into JWand
# TODO --debug into JWand
use strict;
use warnings;
use Data::Dumper; my $dd;
use Getopt::Long; ## qw(:config no_ignore_case bundling no_auto_abbrev);
use Pod::Usage;
#
# <instance-definition>
# := <usr> , ':' , <pwd> , ':' , <uri-spec> , ':' <project-list> ;
# <uri-spec>
# := <protocol> , '://' , <host-spec> , <path-spec> ;
# <protocol>
# := [ 'http' | 'https' | 'file' ] ;
# <host-spec>
# := <host> , [ ':' <port> ] ;
# <path-spec>
# := [ '' | <path-segment> ] ;
# <path-segment>
# := '/' , { <alpha> | <digit> | <printable> } , [ <path-segment> ] ;
# <project-list>
# := { <alpha> } , [ ',' { <alpha> } ] ;
sub _parse_instance_option {
my ($ahref,$str) = @_;
my ($usr,$pwd,$uri,$prj);
return(undef);
}
sub _quick_line_preparation {
my $val = shift;
$val =~ s/\n\r//g; # trailing \n\r e.g. chomp() or chop()
$val =~ s/\#.*//g; # everything after a hash ('#') character e.g. comment
$val =~ s/\s+$//g; # any trailing whitespace
$val =~ s/^\s+//g; # any leading whitespace
# print("'$val'\n");
return($val);
}
sub _parse_configuration_file {
my ($file) = @_;
my ($fh,$val,$a,$b,$c,$d);
my @opts = ( );
return (undef) if ((! -f $file) || (!open($fh,"<$file")));
while (<$fh>) {
my $val = _quick_line_preparation($_);
if ($val =~ m/^(\S+)\s+(\S+)\s+\{/) {
$a = lc($1);
$b = $2;
bin/jmerge.pl view on Meta::CPAN
$lref->{resolutions} = $wand->grabResolutions() if ($OPTS->{GRAB_RESOLUTIONS});
if ($OPTS->{DEBUG} == 2) { $dd = Data::Dumper->new([$lref->{resolutions}]); print $dd->Dump();
} elsif ($OPTS->{DEBUG} >= 3) { $dd = Data::Dumper->new([$lref]); print $dd->Dump();
}
if ($OPTS->{VERBOSE}) {
print("resolutions:");
foreach my $key (@{$lref->{resolutions}}) {
print(" '",$key->{name}."'");
}
print("\n");
}
$lref->{statuses} = $wand->grabStatuses() if ($OPTS->{GRAB_STATUSES});
if ($OPTS->{DEBUG} == 2) { $dd = Data::Dumper->new([$lref->{statuses}]); print $dd->Dump();
} elsif ($OPTS->{DEBUG} >= 3) { $dd = Data::Dumper->new([$lref]); print $dd->Dump();
}
if ($OPTS->{VERBOSE}) {
print("statuses:");
foreach my $key (@{$lref->{statuses}}) {
print(" '",$key->{name},"'");
}
print("\n");
}
$lref->{project_roles}= $wand->grabProjectRoles() if ($OPTS->{GRAB_PROJECTROLES});
if ($OPTS->{DEBUG} == 2) { $dd = Data::Dumper->new([$lref->{project_roles}]); print $dd->Dump();
} elsif ($OPTS->{DEBUG} >= 3) { $dd = Data::Dumper->new([$lref]); print $dd->Dump();
}
if ($OPTS->{VERBOSE}) {
print("project_roles:");
foreach my $key (@{$lref->{project_roles}}) {
print(" '",$key->{name},"'");
}
print("\n");
}
exit(0);
$lref->{resolutions} = $wand->grabResolutions() if ($OPTS->{GRAB_RESOLUTIONS});
$lref->{statuses} = $wand->grabStatuses() if ($OPTS->{GRAB_STATUSES});
$lref->{project_roles}= $wand->grabProjectRoles() if ($OPTS->{GRAB_PROJECTROLES});
$lref->{components} = $wand->grabComponents(@{$OPTS->{PROJECTS}}) if ($OPTS->{GRAB_COMPONENTS});
$lref->{versions} = $wand->grabVersions(@{$OPTS->{PROJECTS}}) if ($OPTS->{GRAB_VERSIONS});
$lref->{project_info} = $wand->grabProjectInfo(@{$OPTS->{PROJECTS}});
$lref->{project_role_actors} =
$wand->grabProjectRoleActors($OPTS->{PROJECTS},$lref->{project_roles});
## $wand->grabAttachments('./attachments', @{$OPTS->{PROJECTS}});
## $dd = Data::Dumper->new([$wand]); print $dd->Dump();
__END__ ### End of Program Source
=head1 NAME
jira-remote-merge.pl - A tool to integrate a remote JIRA instance with a local XML backup file.
=head1 SYNOPSIS
jira-remote-merge.pl [<option> [...]] [<arg> [...]]
=head1 OPTIONS
=over 15
=item -?,--help
print short and long help messages
=item --verbose
show run-time progress information
=item -U,--url
URL for accessing SOAP functions of the JIRA instance
=item -U,--username
=item -P,--password
username and password used to authenticate to the remote server
=item -i,--infile
=item -o,--outfile
=item -V,--validate
=back
=head1 DESCRIPTION
B<This program> will read the given input file(s) and do something
useful with the contents thereof.
There can be several paragraphs.
Each with a line in between.
=head2 Additional Options
=over 15
=item --debug
Display debug information about program structures and status as it is running.
This is useful to make sure the program is parsing and acting on the data in ways you
expect.
=item --loglevel
=item --logfile
=item -t,--timeout
( run in 1.512 second using v1.01-cache-2.11-cpan-364913b4093 )