releasesystem

 view release on metacpan or  search on metacpan

rlsmgr/deploy_content  view on Meta::CPAN

    if ($info->{transport} eq 'http')
    {
        ($res, $bad, $error_list) = mirror_upload($file, $project, $FQDN,
                                                  $hostlist, $config, $info);

        if (! $res)
        {
            my $date = scalar localtime;

            for $host (@$bad)
            {
                $res = shift(@$error_list);

                write_log_line("$log_dir/$cmd",
                               "$date [$$] Mirror FAILED to host $host: $res");
                write_log_line("$tfile",
                               "$cmd [$$] [$date] Mirroring FAILED to host " .
                               "$host: $res")
                    if ($trace);
            }

            return 0;
        }
    }
    else # ftp
    {
        my $date = scalar localtime;

        write_log_line("$log_dir/$cmd",
                       "$date [$$] FTP mirroring should be done by client");
        write_log_line("$tfile",
                       "$cmd [$$] [$date] FTP mirroring is not supported at " .
                       "the server level")
            if ($trace);

        # Not *really* an error
        return 1;
    }

    1;
}

__END__

=head1 NAME

deploy_content - Perform the tasks associated with deploying a new package

=head1 SYNOPSIS

deploy_content [ B<-t> I<num> ] [ B<-T> I<file> ] [ B<-c> I<file> ] mirror_group file

=head1 DESCRIPTION

The B<deploy_content> application is the second stage on the server-side of
the release manager process. It is generally called by B<rlsmgrd> when there
is a package in the incoming area that requires deployment.

The role of this tool is to validate the new package file, verify the
checksum, dissolve the archive into a staging area, and invoke the third-stage
tool to manage the relocation of data from the staging area to the actual
web server directories.

=head1 OPTIONS

B<deploy_content> requires that a I<mirror group> be specified on the 
command-line. This group name uniquely identifies a group of one or more
servers that handle a given externally-visible hostname. Following this, there
needs to be the name of the info file for the package being processed. This
will be sought in either the incoming or staging directories (which are
defined in the mirror group specification). In addition to these required
values, the following options are recognized:

=over

=item B<-t I<num>>

Specify a tracing level to be used for diagnostics (see the B<-T> option
below). The value is used internally as a bit-mask, so a value of 5 is in
fact specifying the combination of 1 and 4, while exluding 2. Currently, only
the first four bits are used. (A detailed description of what each bit does
will soon follow.)

=item B<-T I<file>>

Specifiy the file that diagnostics are written to. Not to be confused with
the general tool logfile, which generally only notes the very high-level
events. If not specified, and a non-zero value for B<-t> is specified, this
will default to ``rlsmgrd-trace'' in the same logging directory as other logs
are written to.

=item B<-c I<file>>

Instruct the tool to read configuration from the specified file rather than
the Oracle database. This is meant mainly for debugging and for mirror groups
that contain only one host. This is not a good idea for mirror groups with
two or more hosts, as the database is specifically utilized so as to avoid
configurations diverging from one host to the next. (Description of the
configuration file format will be added later.)

=back

=head1 CONFIGURATION SPECIFICATION

In order to read configuration data from the Oracle RDBMS, the tool must
have a database name/address, and a user ID and password. It would be insecure
to pass these either on the command-line or via environment variables. To that
end, if the tool attempts to use the Oracle data source (in the absence of
a B<-c> option, above) then it looks for a control file in the same directory
as the tool itself resides in. The name of the control file must be the mirror
group name as passed on the command line, with a suffix of ``C<.rc>'' added.

The file itself should contain only one or two lines. The first line should
be of the form:

        username:password

The password should I<not> be encrypted. The second line, if specified, should
be the database name. If this is not specified, the value of the environment
variable B<ORACLE_SID> is used. It is assumed that the environment variable
B<ORACLE_HOME> is already set.



( run in 0.747 second using v1.01-cache-2.11-cpan-5511b514fd6 )