перенаправление вывода сборки сапфора в файлы. Осталось сделать рассылку.
This commit is contained in:
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@@ -8,8 +8,9 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Constants.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SynchronizeTestsTasks.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/SynchronizeTestsTasks.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/InstallServerSapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/InstallServerSapfor.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SSH/ConnectionPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/SSH/ConnectionPass.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class Constants {
|
|||||||
public final static String parse_err_file = "parse_err.txt";
|
public final static String parse_err_file = "parse_err.txt";
|
||||||
public final static String out_file = "out.txt";
|
public final static String out_file = "out.txt";
|
||||||
public final static String err_file = "err.txt";
|
public final static String err_file = "err.txt";
|
||||||
|
public final static String script = "script.sh";
|
||||||
public final static String time_file = "total_time";
|
public final static String time_file = "total_time";
|
||||||
//-служебные разделы проекта.
|
//-служебные разделы проекта.
|
||||||
public static final String data = "visualiser_data";
|
public static final String data = "visualiser_data";
|
||||||
|
|||||||
@@ -50,26 +50,27 @@ public class InstallServerSapfor extends ConnectionPass<Object> {
|
|||||||
RemoteFile testingSystemHome = new RemoteFile(sftpChannel.pwd(), "testing_system", true);
|
RemoteFile testingSystemHome = new RemoteFile(sftpChannel.pwd(), "testing_system", true);
|
||||||
RemoteFile repo = new RemoteFile(testingSystemHome.full_name, "Repo", true);
|
RemoteFile repo = new RemoteFile(testingSystemHome.full_name, "Repo", true);
|
||||||
RemoteFile repoSapforHome = new RemoteFile(repo.full_name + "/sapfor/experts/Sapfor_2017/_bin", true);
|
RemoteFile repoSapforHome = new RemoteFile(repo.full_name + "/sapfor/experts/Sapfor_2017/_bin", true);
|
||||||
RemoteFile old_bin = new RemoteFile(repoSapforHome.full_name, "Sapfor_F");
|
//--
|
||||||
if (Exists(repoSapforHome.full_name, "Sapfor_F"))
|
|
||||||
sftpChannel.rm(old_bin.full_name);
|
|
||||||
ShowMessage2("Вывод в консоли визуализатора");
|
|
||||||
//-->>
|
|
||||||
ShowMessage1("Синхронизация ветви DVM...");
|
ShowMessage1("Синхронизация ветви DVM...");
|
||||||
ShellCommand("cd " + Utils.DQuotes(repo.full_name), "svn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + Constants.DVM_REPOSITORY + "\n");
|
ShellCommand("cd " + Utils.DQuotes(repo.full_name), "svn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + Constants.DVM_REPOSITORY + "\n");
|
||||||
ShowMessage1("Синхронизация ветви SAPFOR...");
|
ShowMessage1("Синхронизация ветви SAPFOR...");
|
||||||
ShellCommand("cd " + Utils.DQuotes(repo.full_name), "svn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + Constants.SAPFOR_REPOSITORY + "\n");
|
ShellCommand("cd " + Utils.DQuotes(repo.full_name), "svn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + Constants.SAPFOR_REPOSITORY + "\n");
|
||||||
ShowMessage1("Сборка SAPFOR...");
|
ShowMessage1("Сборка SAPFOR...");
|
||||||
ShellCommand("cd " + Utils.DQuotes(repoSapforHome.full_name), "cmake ../", "make -j 4");
|
//-
|
||||||
|
RemoteFile repo_bin = new RemoteFile(repoSapforHome.full_name, "Sapfor_F");
|
||||||
|
if (Exists(repoSapforHome.full_name, repo_bin.name))
|
||||||
|
sftpChannel.rm(repo_bin.full_name);
|
||||||
|
//--
|
||||||
|
performScript(repoSapforHome, "cmake ../", "make -j 4" );
|
||||||
|
// ShellCommand("cd " + Utils.DQuotes(repoSapforHome.full_name), "cmake ../", "make -j 4");
|
||||||
result = Exists(repoSapforHome.full_name, "Sapfor_F");
|
result = Exists(repoSapforHome.full_name, "Sapfor_F");
|
||||||
if (result) {
|
if (result) {
|
||||||
RemoteFile sapforsDirectory = new RemoteFile(testingSystemHome.full_name, "Sapfors", true);
|
RemoteFile sapforsDirectory = new RemoteFile(testingSystemHome.full_name, "Sapfors", true);
|
||||||
//создать папку. Для того чтобы скопировать из репозитория.
|
//создать папку. Для того чтобы скопировать из репозитория.
|
||||||
RemoteFile sapforHome = new RemoteFile(sapforsDirectory.full_name, Utils.getDateName("sapfor"));
|
RemoteFile sapforHome = new RemoteFile(sapforsDirectory.full_name, Utils.getDateName("sapfor"));
|
||||||
tryMKDir(sapforHome);
|
tryMKDir(sapforHome);
|
||||||
RemoteFile repoSapforBin = new RemoteFile(repoSapforHome, "Sapfor_F");
|
|
||||||
RemoteFile sapforBin = new RemoteFile(sapforHome, "Sapfor_F");
|
RemoteFile sapforBin = new RemoteFile(sapforHome, "Sapfor_F");
|
||||||
copy(repoSapforBin, sapforBin);
|
copy(repo_bin, sapforBin);
|
||||||
//-->>>
|
//-->>>
|
||||||
serverSapfor = new ServerSapfor();
|
serverSapfor = new ServerSapfor();
|
||||||
serverSapfor.home_path = sapforHome.full_name;
|
serverSapfor.home_path = sapforHome.full_name;
|
||||||
|
|||||||
@@ -387,6 +387,25 @@ public abstract class ConnectionPass<T> extends Pass_2021<T> {
|
|||||||
if (!Exists(dir.parent, dir.name)) sftpChannel.mkdir(dir.full_name);
|
if (!Exists(dir.parent, dir.name)) sftpChannel.mkdir(dir.full_name);
|
||||||
}
|
}
|
||||||
//--
|
//--
|
||||||
|
public void performScript(RemoteFile directory, String... commands) throws Exception {
|
||||||
|
RemoteFile script_file = new RemoteFile(directory.full_name, Constants.script);
|
||||||
|
RemoteFile out = new RemoteFile(directory.full_name, Constants.out_file);
|
||||||
|
RemoteFile err = new RemoteFile(directory.full_name, Constants.err_file);
|
||||||
|
//
|
||||||
|
Vector<RemoteFile> files = new Vector<>();
|
||||||
|
files.add(script_file);
|
||||||
|
files.add(out);
|
||||||
|
files.add(err);
|
||||||
|
for (RemoteFile file : files) {
|
||||||
|
if (Exists(directory.full_name, file.name))
|
||||||
|
sftpChannel.rm(file.full_name);
|
||||||
|
}
|
||||||
|
//--
|
||||||
|
writeToFile(String.join("\n", commands), script_file);
|
||||||
|
//--
|
||||||
|
ShellCommand("cd " + Utils.DQuotes(directory.full_name),
|
||||||
|
script_file.full_name + " 1>" + Constants.out_file + " 2>" + Constants.err_file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user