IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 14, 2009, 3:14:27 PM (17 years ago)
Author:
bills
Message:

add task to build data store filesets for distRuns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/dist_make_fileset.pl

    r23838 r23861  
    3939
    4040# Parse the command-line arguments
    41 my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $prod_id, $product_name, $product_root, $ds_dbhost, $ds_dbname);
     41my ($dist_id, $dist_dir, $target_id, $stage, $stage_id, $prod_id, $product_name, $ds_dbhost, $ds_dbname);
    4242my ($dbname, $save_temps, $verbose, $no_update, $logfile);
    4343
     
    5050           'prod_id=s'      => \$prod_id,    # id for the product
    5151           'product_name=s' => \$product_name,  # location of the data store directory for this product
    52            'product_root=s' => \$product_root,  # location of the data store directory for this product
    5352           'ds_dbhost=s'    => \$ds_dbhost,  # database host for the datastore database
    5453           'ds_dbname=s'    => \$ds_dbname,  # database name for the datastore database
     
    6160
    6261pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    63 pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --prod_id --product_root --ds_dbhost --ds_dbname",
     62pod2usage( -msg => "Required options: --dist_id --dist_dir --target_id --stage --stage_id --prod_id --ds_dbhost --ds_dbname",
    6463           -exitval => 3) unless
    6564    defined $dist_id and
     
    7069    defined $prod_id and
    7170    defined $product_name and
    72     defined $product_root and
    7371    defined $ds_dbhost and
    7472    defined $ds_dbname;
     
    156154
    157155# XXX: disttool -addrcdsfileset
    158 
    159 # XXX todo: add rcRun's for the destinations
     156{
     157    my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -name $fileset_name";
     158    $command .= " -dbname $dbname" if $dbname;
     159
     160    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     161        run(command => $command, verbose => $verbose);
     162    unless ($success) {
     163        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     164        &my_die("Unable to perform $command error_code: $error_code", $dist_id, $prod_id, $error_code);
     165    }
     166}
     167
    160168
    161169
     
    239247    print STDERR "$msg\n";
    240248
     249    my $command = "$disttool -addfileset -dist_id $dist_id -prod_id $prod_id -fault $fault";
     250    $command .= " -dbname $dbname" if $dbname;
     251
     252    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     253        run(command => $command, verbose => $verbose);
     254    unless ($success) {
     255        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     256        print STDERR "Unable to perform $command error_code: $error_code\n";
     257    }
    241258    exit $fault;
    242259}
Note: See TracChangeset for help on using the changeset viewer.