build_package.pl
changeset 40 6661369591af
parent 39 d6975a94a893
child 41 177164b3c155
equal deleted inserted replaced
39:d6975a94a893 40:6661369591af
   166 $sConfigArg .= " -Dsf.config.rev=$sFbfConfigRev" if ($sFbfConfigRev);
   166 $sConfigArg .= " -Dsf.config.rev=$sFbfConfigRev" if ($sFbfConfigRev);
   167 $sConfigArg = "-Dsf.config.dir=$sFbfConfigDir" if ($sFbfConfigDir);
   167 $sConfigArg = "-Dsf.config.dir=$sFbfConfigDir" if ($sFbfConfigDir);
   168 my $sProjectArg = "-Dsf.project.repo=$sFbfProjectRepo";
   168 my $sProjectArg = "-Dsf.project.repo=$sFbfProjectRepo";
   169 $sProjectArg .= " -Dsf.project.rev=$sFbfProjectRev" if ($sFbfProjectRev);
   169 $sProjectArg .= " -Dsf.project.rev=$sFbfProjectRev" if ($sFbfProjectRev);
   170 $sProjectArg = "-Dsf.project.dir=$sFbfProjectDir" if ($sFbfProjectDir);
   170 $sProjectArg = "-Dsf.project.dir=$sFbfProjectDir" if ($sFbfProjectDir);
   171 print("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir\n");
   171 my $sBootstrapCmd = "hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir";
   172 system("hlm -f bootstrap.xml $sConfigArg $sProjectArg -Dsf.target.dir=$sJobDir >console_bootstrap_$$.txt 2>&1");
   172 print("$sBootstrapCmd\n");
       
   173 open(LOG, ">console_bootstrap_$$.txt")
       
   174 open(PIPE, "$sBootstrapCmd 2>&1 |");
       
   175 while(<PIPE>)
       
   176 {
       
   177 	print LOG $_;
       
   178 	print $_;
       
   179 }
       
   180 close(PIPE);
       
   181 close(LOG);
   173 
   182 
   174 # check that $sNUMBERS_FILE exists, otherwise create it
   183 # check that $sNUMBERS_FILE exists, otherwise create it
   175 if (!-f $sNUMBERS_FILE)
   184 if (!-f $sNUMBERS_FILE)
   176 {
   185 {
   177 	open FILE, ">$sNUMBERS_FILE";
   186 	open FILE, ">$sNUMBERS_FILE";
   228 my $sSubProjArg = '';
   237 my $sSubProjArg = '';
   229 $sSubProjArg = "-Dsf.subproject.path=$sSubProject" if ($sSubProject);
   238 $sSubProjArg = "-Dsf.subproject.path=$sSubProject" if ($sSubProject);
   230 print("cd $sJobDir\\sf-config\n");
   239 print("cd $sJobDir\\sf-config\n");
   231 chdir("$sJobDir\\sf-config");
   240 chdir("$sJobDir\\sf-config");
   232 print "###### BUILD PREPARATION ######\n";
   241 print "###### BUILD PREPARATION ######\n";
   233 print("hlm sf-prep -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg\n");
   242 my $sPreparationCmd = "hlm sf-prep -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg";
   234 system("hlm sf-prep -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg >console_sfprep_$$.txt 2>&1");
   243 print("$sPreparationCmd\n");
       
   244 open(LOG, ">console_sfprep_$$.txt")
       
   245 open(PIPE, "$sPreparationCmd 2>&1 |");
       
   246 while(<PIPE>)
       
   247 {
       
   248 	print LOG $_;
       
   249 	print $_;
       
   250 }
       
   251 close(PIPE);
       
   252 close(LOG);
   235 
   253 
   236 print "###### EXECUTE BUILD ######\n";
   254 print "###### EXECUTE BUILD ######\n";
   237 print("hlm sf-build-all -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg\n");
   255 my $sBuildallCmd = "hlm sf-build-all -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg";
   238 system("hlm sf-build-all -Dsf.project.type=package $sSubProjArg -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpt $sNoPublishOpt $sJobRootDirArg >console_sfbuildall_$$.txt 2>&1");
   256 print("$sBuildallCmd\n");
       
   257 open(LOG, ">console_sfbuildall_$$.txt")
       
   258 open(PIPE, "$sBuildallCmd 2>&1 |");
       
   259 while(<PIPE>)
       
   260 {
       
   261 	print LOG $_;
       
   262 	print $_;
       
   263 }
       
   264 close(PIPE);
       
   265 close(LOG);
   239 
   266 
   240 # copy console outputs to remote log archive
   267 # copy console outputs to remote log archive
   241 if (-d "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs")
   268 if (-d "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs")
   242 {
   269 {
   243 	my $sTgtDir = "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs\\console";
   270 	my $sTgtDir = "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs\\console";