hi.
The following code of filelist deployment gets fails, can anyone correct me.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<deploymentConfiguration>
<logRules maxBytes="32Mb" level="verbose" >
</logRules>
<localNode host="app-dev003.com" />
<replicationFarmSet >
<replicationFarm name="MYFARMNAME" >
<nodeRef useNode="microsites_web_dit" />
</replicationFarm>
</replicationFarmSet>
<definition name="microsites_web" >
<source >
<sourceFilesystem area="$area" filelist="$file" >
<pathSpecification>
<path name = "."/>
</pathSpecification>
</sourceFilesystem>
</source>
<target useReplicationFarm="MYFARMNAME" >
<targetFilesystem area="microsites_web_dit" />
<replicationFarmLink >
<internal name="MYFARMNAME" />
</replicationFarmLink>
</target>
</definition>
<deployment transactional="yes" >
<execDeploymentTask useDefinition="microsites_web" />
</deployment>
</deploymentConfiguration>
following is the deployAsset_ipl.ipl********************************************************
#!/usr/iw-home/iw-perl/bin/iwperl
use TeamSite::WFtask;
use TeamSite::WFworkflow;
use TeamSite::Config;
use Log;
# Assign key parameters to variables.
my $microsites_asset_deployment = $ARGV[0];
my $jobid = $ARGV[1];
my $task_id=$ARGV[2];
my $area = $ARGV[3];
# Get a logging object.
my $log=new Log($task_id);
# Print out all parameters provided to the script
my $count=0;
foreach my $parameter (
@ARGV) {
$log->record( "Parameter $count is: $parameter.\n");
$count +=1;
}
$log->record("Received '$count' arguments:\n");
# Instantiate task object for interaction with the calling workflow (Job).
my ($task) = new TeamSite::WFtask($task_id);
# get the opendeploy home
my ($odhomeConfigFile) = "/etc/defaultiwodhome";
open (READIN, "< $odhomeConfigFile") || printErrorAndDie("Unable to open $odhomeConfigFile\n");
my($iwodhome) = < READIN>;
chomp($iwodhome);
close READIN;
if ($iwodhome eq "") {
&printErrorAndDie("Open Deploy home not found\n");
}
# Get all files to be deployed and add them to the filelist
my
@pre_attached_files = $task->GetFiles();
my $filelist = "$iwodhome/tmp/filelist.$$";
$log->record( "Filelist is: $filelist\n" );
open(FILELIST, ">$filelist");
foreach $file (
@pre_attached_files) {
$log->record( "Adding file to filelist: $file\n" );
print FILELIST "$file\n";
}
close FILELIST;
# Build deploy command and run it.
my $Deploy_files_command= "$iwodhome/bin/iwodstart $microsites_asset_deployment -inst $$ -k src=$area -k filename=$file 2>&1 ";
$log->record( "$Deploy_files_command \n" );
@output =`$Deploy_files_command`;
$rc = $?;
#Check for the success/failure of the deployment process.
$log->record( "Results flag= $rc \n" );
foreach (
@output) {
$rc = 1 if (/ERROR/i);
$rc = 1 if (/Status: Failed/i);
$log->record( "$_" );
}
$log->record( "check success\n" );
if ($rc eq "0" ) {
$log->record( "inside success\n" );
$task->CallBack(0, "Deployment Successful");
}
else {
&printErrorAndDie("Deployment failed.\n");
}
exit(0);
# record the error in the log file and call back to the workflow with failure message
sub printErrorAndDie{
$log->record(
@_);
$task->CallBack(1,
@_);
exit 1;
}
this is the wft file****************************************************************************************************************************************
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE workflow SYSTEM "iwwf.dtd">
<template_script><![CDATA[
#Server: (Offline)
#Version: 5.5.2
#Build 9275 20020617
##########----------Beginning of customized text section----------##########
# Put your addition to the Workflow Template here
my $MyOwner = __VALUE__('iw_user');
# 3 Mal Aufruf der E-Mail mit unterschiedlichen Texten und Folgetask
my
@externalcmd = (
"/usr/iw-home/iw-perl/bin/iwperl /iwmnt/default/main/www/_LibMod/WORKAREA/WebTeam/WorkFlow/Microsites/deployAsset_ipl.ipl",
);
##########----------End of customized text section----------##########
use TeamSite::Config;
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
#=====================================================================
# Name: iw_cleanup_paths
# Args: bp - branch path
# wa - workarea name
# Usage: ($b, $w, $a) = iw_cleanup_paths($bp, $wa);
# Purpose: Function used to clean up leading and trailing blanks
# from branch path and work area path, then derive
# $areavpath.
# Returns: Cleaned branch path, workarea, and generated areavpath
#=====================================================================
sub iw_cleanup_paths {
my ($bp, $wa) =
@_;
# clean up leading and trailing slashes so we don't
# end up hassling the user over including/excluding them
$bp =~ s|^\s*/*([^/].*\S)/\s*$|$1|;
$wa =~ s|^\s*/*([^/].*\S)/\s*$|$1|;
#=# (Note - this code may need to change when we start supporting
#=# multiple archives [Arnold])
$bp = "main/$bp" if ($bpath !~ /^main/);
$areavpath = TeamSite::CGI_lite::escape_html_data(
"/default/$bp/WORKAREA/$wa");
return ($bp, $wa, $areavpath);
}
#=====================================================================
# Name: iw_set_area
# Args: btag - TAG_info variable name for branch path.
# watag - TAG_info variable name for workarea.
# Usage: ($a, $b, $w, $s) = set_area("$btag", "$watag");
# Purpose: If the built-in variables for branch and workarea have
# not been set, pull the information from the workflow
# instantiation form (using the btag and watag info).
# Use the branch and workarea information to generate
# a valid areavpath (using a library routine)
# Returns: Returns the generated areavpath, the branch path, the
# workarea name, and a boolean indicating whether or not
# the branch and workarea need to be prompted for during
# instantiation (this relies on the fact that this code
# is run multiple times during the instantion process).
#=====================================================================
sub iw_set_area{
my($btag, $watag) =
@_;
my($avpath, $bpath, $wapath, $skip);
my($iwbpath, $iwwapath) = (__VALUE__("iw_branch"),
__VALUE__("iw_workarea"));
if ((length($iwbpath)) > 0 && (length($iwwapath)) > 0){
$bpath = $iwbpath;
($wapath = $iwwapath) =~ s|^\s*/.*

|;
$wapath =~ s|/\s*$||;
return("$wapath", "$iwbpath", "$wapath", "TRUE");
}
($bpath, $wapath, $avpath) = iw_cleanup_paths(__VALUE__("$btag"),
__VALUE__("$watag"));
return("$avpath", "$bpath", "$wapath", "FALSE");
}
my($iw_area_vpath, $iw_branch_path, $iw_work_area, $iw_skip_branch) =
iw_set_area("branch_path", "work_area");
#======================================================================
# Name: iw_get_mail_cmd
# Args: type - either "iwsend_mail" or "iwsend_servlet_mail"
# addr - 'To:' email address
# Usage: __INSERT__(iw_get_mail_cmd("$type", "$addr"));
# Purpose: This function generates the command statement called
# by the external email notification task.
# Returns: Returns the generated XML string.
# Note: Defaults to iwsend_servlet_mail.ipl unless $type is
# explicitly set to iwsend_mail
#=# (this will hopefully change with the next version of iwsend_mail)
#=# (when that happens, either drop type, or make it a second
#=# [optional] argument, that if set - assumes the program lives in
#=# iw-home/local/bin ?)
#=====================================================================
sub iw_get_mail_cmd {
# NT lacks the ability to bind a script executor with a
# script on a 'shebang' line (eg: #!/blah/blah/iwperl)
# Instead it uses the assoc/ftype mechanism which employs
# the use of environment variables that are not always
# available (cf: IIS's metabasse, which replicates the
# extention-based association scheme on its own). Therefore,
# we need to spoon-feed iwperl the script like this for now:
my($type, $taskName, $addr) =
@_;
return(sprintf("<command v='%s$iwhome/bin/%s %s'/>",
($^O eq "MSWin32") ? "$iwhome/iw-perl/bin/iwperl " : "",
($type eq "iwsend_mail") ?
"$type.ipl" : "iwsend_servlet_mail.ipl",
($taskName eq "" ) ? $addr: "$taskName $addr"));
}
#=====================================================================
# Name: iw_getrole
# Args: role - basename of a TeamSite role (*.uid) file, or
# similarly constructed customized file in the
# same directory.
# Usage: $html = iw_getrole("master");
# Purpose: Generate an HTML formatted drop-down menu of all
# entries in named file for use within a TAG_info()
# section.
# Returns: Returns the generated drop down list on success, or
# a text field with an error message if it was unable
# to open the file.
#=====================================================================
sub iw_getrole{
my($role) =
@_;
$role .= ".uid" if ($role !~ /\.uid$/);
my($html) = "";
if (!open(IN, "<$iwhome/conf/roles/$role")){
$html = "<input type='text' value='--Error opening $role--'>";
}
else {
$html = "<select size='1'>\n<option>\n";
foreach (sort(<IN>)){
s/^\s*//gs; s/\s*$//gs;
$html .= "<option>$_\n";
}
close(IN);
$html .= "</select>\n";
}
return($html);
}
#=# (changed reference to renamed subroutine)
my($iw_admin_html) = iw_getrole("admin");
my($iw_masters_html) = iw_getrole("master");
my($iw_authors_html) = iw_getrole("author");
my($iw_editors_html) = iw_getrole("editor");
#=====================================================================
# file list for start task
#=====================================================================
my($iw_selected_files) = iw_get_filelist();
#=====================================================================
# Name: iw_get_filelist
# Args: None.
# Usage: $xml = iw_get_filelist();
# Purpose: Generate an XML formatted list of all the files that
# were pre-selected when the workflow was initiated.
# Returns: Returns the XML formatted list if files were selected.
# Returns an empty string if no files were selected.
# Notes: Sorts the filelist in uuencode form, then html-encodes
# each entry using a library routine - all this using
# the Sambre-Janken transform algorithm
#=====================================================================
sub iw_get_filelist{
my($files) = "";
if (__ELEM__('iw_file')){
my(
@flist) = map {
TeamSite::CGI_lite::escape_html_data($_);
} sort map {
tr|\\|/|;
s|^\Q$iw_area_vpath\E||;
$_;
} __VALUE__('iw_file');
$files = "<files>\n";
for (my $i = 0; $i <
@flist; ++$i) {
$files .= "\t<file path='$flist[$i]' comment='task file'/>\n";
}
$files .= "</files>\n";
}
return($files);
}
##############################################################################
my $MyOwner = __VALUE__('iw_user');
my $MyVpath = __VALUE__('iw_workarea');
my $MyAreaOwner = __VALUE__('iw_areaowner');
]]>
</template_script>
<workflow name = "MicrositesPreviewAssetDeployment" owner = "__INSERT__($MyOwner);" creator = "__TAG__('iw_user');">
<externaltask lock = "f" name = "filelist" owner = "__INSERT__($MyOwner);" retry = "t" start = "t">
<areavpath v = "__INSERT__($MyVpath);"/>
<successors>
<successorset description = "Deployment Complete">
<succ v = "EndTask"/>
</successorset>
</successors>
<command v = "__INSERT__($externalcmd[0]);"/>
__INSERT__($iw_selected_files);
</externaltask>
<endtask name = "EndTask">
<activation>
<or>
<pred v = "filelist"/>
</or>
</activation>
</endtask>
</workflow>