sub Publish_All(){ for $mount (@IWStores){ for (`$IWList $mount`){push(@branch_list,$mount . "\\" . $_)} } for my $LocalBranch (@branch_list){ chomp($LocalBranch); my @LocalBranches = `$IWList $LocalBranch`; for (@LocalBranches){ chomp($_); unless ( ($_ =~ /EDITION/) || ($_ =~ /STAGING/) || ($_ =~ /WORKAREA/) ){ push(@branch_list,$LocalBranch . "\\" . $_); my $EditionName = $_ . "." . $full_year . "" . $mon . "" . $mday; system($IWPublish,"-f",$LocalBranch . "\\" . $_,"STAGING",$EditionName,"AutoPublish before daily backups"); } } }}sub Find_Stores{ my @StoreAdmResp = `$iwbin/iwstoreadm -l`; for (@StoreAdmResp){@ThisStore = split(/\s+/); push(@IWStores,$iw_mount . "\\" . $ThisStore[0]); }}my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime $time;$mon += 1;if ($mday <= 9){$mday = "0" . $mday;}if ($mon <= 9){$mon = "0" . $mon;}$full_year = $year + 1900;
I use the combination of these two functions to find all the stores on the system (Find_Stores) and then publish all the branches on each store that have submissions to publish(Publish_All).This will not create editions if there are not any changes.This will name the editions using the name of the branch followed by the date in the format YYYYMMDD.