++
перевод тестов на гит, рефакторинг проходов загрузки репозитория
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.CommonConstants;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.ProcessPass;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadDvmRepository extends ProcessPass {
|
||||
/*
|
||||
git clone https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm /home/testuser/Repo/DVM/
|
||||
git clone https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm-auto-test /home/testuser/Repo/DVM_AUTO_TEST/
|
||||
*/
|
||||
File dvmHome;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
dvmHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
|
||||
"dvm").toFile();
|
||||
return true;
|
||||
}
|
||||
private void synchronize(String src, File dst) throws Exception {
|
||||
File loadedFile = Paths.get(dst.getAbsolutePath(), CommonConstants.LOADED).toFile();
|
||||
if (loadedFile.exists()) {
|
||||
PerformScript("cd " +
|
||||
dst.getAbsolutePath() +
|
||||
"\nsvn update " + Constants.REPOSITORY_AUTHENTICATION + "\n");
|
||||
} else {
|
||||
Utils.CleanDirectory(dst);
|
||||
PerformScript("cd Repo\nsvn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + src + "\n"); //export
|
||||
FileUtils.write(loadedFile, "");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
ShowProgress(1, 0, true);
|
||||
synchronize(Constants.DVM_REPOSITORY, dvmHome);
|
||||
ShowProgress(1, 1, true);
|
||||
}
|
||||
}
|
||||
22
src/_VisualDVM/Passes/All/DownloadDvmTestsRepository.java
Normal file
22
src/_VisualDVM/Passes/All/DownloadDvmTestsRepository.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.ProcessPass;
|
||||
import _VisualDVM.Passes.Repository.DownloadRepositoryPass;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadDvmTestsRepository extends DownloadRepositoryPass {
|
||||
/*
|
||||
git clone https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm DST
|
||||
git clone https://dvmguest:dvmguest@dvm.keldysh.ru/dvm-system/dvm-auto-test DST
|
||||
*/
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return super.canStart(Constants.DVM_TESTS_REPOSITORY, "dvm-auto-test");
|
||||
}
|
||||
}
|
||||
@@ -4,46 +4,19 @@ import Common.Utils.Utils_;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.ProcessPass;
|
||||
import _VisualDVM.Passes.Repository.DownloadRepositoryPass;
|
||||
import _VisualDVM.Utils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadSapforRepository extends ProcessPass {
|
||||
File sapforHome;
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Загрузка репозитория";
|
||||
}
|
||||
public class DownloadSapforRepository extends DownloadRepositoryPass {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
sapforHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
|
||||
"SAPFOR").toFile();
|
||||
return true;
|
||||
}
|
||||
private void synchronize(String src, File dst) throws Exception {
|
||||
File loadedFile = Paths.get(dst.getAbsolutePath(), CommonConstants.LOADED).toFile();
|
||||
if (loadedFile.exists()) {
|
||||
PerformScript("cd " + dst.getAbsolutePath() + "\n" +
|
||||
"git pull\n" +
|
||||
"cd " + Utils_.DQuotes(sapforHome) + "\n" +
|
||||
"GIT_SSL_NO_VERIFY=true git submodule update --init\n"
|
||||
);
|
||||
} else {
|
||||
Utils.CleanDirectory(dst);
|
||||
PerformScript("cd Repo\n" +
|
||||
"git clone " +
|
||||
Utils_.DQuotes(src) + "\n" +
|
||||
"cd " + Utils_.DQuotes(sapforHome) + "\n" +
|
||||
"GIT_SSL_NO_VERIFY=true git submodule update --init\n"
|
||||
); //export
|
||||
FileUtils.write(loadedFile, "");
|
||||
}
|
||||
return super.canStart(Constants.SAPFOR_REPOSITORY, "SAPFOR");
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
ShowProgress(1, 0, true);
|
||||
synchronize(Constants.SAPFOR_REPOSITORY, sapforHome);
|
||||
ShowProgress(1, 1, true);
|
||||
protected boolean hasSubmodules() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user