|
|
@@ -3,6 +3,8 @@ package devops;
|
|
|
import cn.reghao.bnt.web.devops.build.model.po.RepoAuthConfig;
|
|
|
import cn.reghao.bnt.web.devops.builder.model.constant.RepoAuthType;
|
|
|
import cn.reghao.bnt.web.devops.builder.tool.repo.GitImpl;
|
|
|
+import cn.reghao.bnt.web.devops.deployer.model.po.RemoteHost;
|
|
|
+import cn.reghao.bnt.web.devops.deployer.util.Sftp;
|
|
|
import cn.reghao.jutil.jdk.shell.ShellExecutor;
|
|
|
import cn.reghao.jutil.jdk.shell.ShellResult;
|
|
|
import org.eclipse.jgit.api.Git;
|
|
|
@@ -106,4 +108,17 @@ public class GitTest {
|
|
|
System.out.println(shellResult.getResult());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void sftpTest() throws Exception {
|
|
|
+ String host = "127.0.0.1";
|
|
|
+ int port = 22;
|
|
|
+ String username = "root";
|
|
|
+ String password = "gsh";
|
|
|
+ RemoteHost remoteHost = new RemoteHost(host, port, username, password);
|
|
|
+ Sftp sftp = new Sftp();
|
|
|
+
|
|
|
+ String command = "docker ps -a";
|
|
|
+ sftp.exec(remoteHost, command);
|
|
|
+ }
|
|
|
}
|