v++
This commit is contained in:
@@ -6,8 +6,10 @@ import Common.GlobalProperties;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.LanguageName;
|
||||
import Repository.Component.Sapfor.Sapfor;
|
||||
import Repository.EmailMessage;
|
||||
import Repository.RepositoryRefuseException;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.TasksPackageState;
|
||||
import TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
|
||||
import TestingSystem.Common.TestingPlanner;
|
||||
@@ -23,8 +25,10 @@ import org.apache.commons.io.FileUtils;
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
File workspace;
|
||||
ServerSapfor sapfor;
|
||||
@@ -179,6 +183,9 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
void UpdateSapforState(ServerSapforState state_in) throws Exception {
|
||||
sapfor.state = state_in;
|
||||
ServerCommand(ServerCode.EditObject, sapfor);
|
||||
if (!sapfor.state.isActive()){
|
||||
|
||||
}
|
||||
}
|
||||
void SyncronizeRepository() throws Exception {
|
||||
System.out.println("Синхронизация репозитория...");
|
||||
@@ -258,9 +265,24 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
sapfor.buildDate = new Date().getTime();
|
||||
//--
|
||||
UpdateSapforState(ServerSapforState.Done);
|
||||
EmailSapforAssembly(current_version, true, sapforOut, sapforErr);
|
||||
} else {
|
||||
UpdateSapforState(ServerSapforState.DoneWithErrors);
|
||||
EmailSapforAssembly(current_version, false, sapforOut, sapforErr);
|
||||
}
|
||||
}
|
||||
}
|
||||
void EmailSapforAssembly(int version, boolean done, File out, File err) throws Exception {
|
||||
String version_s = (version == Constants.Nan) ? "?" : String.valueOf(version);
|
||||
String status = done ? "Успешно" : "С ошибками";
|
||||
//-
|
||||
Vector<String> targets = new Vector<>(Arrays.asList(Global.admins_mails));
|
||||
EmailMessage message = new EmailMessage(
|
||||
"Выполнена сборка системы SAPFOR",
|
||||
"Версия: " + version_s + "\n" + "Статус: " + status,
|
||||
targets
|
||||
);
|
||||
//-
|
||||
ServerCommand(ServerCode.Email, "", message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user