Kaynağa Gözat

update DockerTest

reghao 1 yıl önce
ebeveyn
işleme
0bd1b8022e

+ 6 - 8
mgr/src/test/java/cn/reghao/devops/mgr/devops/DockerTest.java

@@ -42,27 +42,25 @@ public class DockerTest {
         String compileHome = "/home/reghao/code/aha/tnb/file/file-service";
         docker.build(repoTag, compileHome);*/
 
-        String image = "docker.alpha.iquizoo.com/node:14.21";
+        String image = "docker.alpha.iquizoo.com/node:16.20.2-buster-slim";
         String sourceCodeDir = "/home/reghao/Downloads/0/tnbapp";
-        sourceCodeDir = "/home/reghao/Downloads/iquizoo.admin/";
+        sourceCodeDir = "/home/reghao/Downloads/0/iquizoo.admin/";
         String nodeModulesDir = "/home/reghao/Downloads/0/node_modules";
         String buildCmd = "npm run build";
         String buildCmd1 = "npm i && npm run build";
         String buildCmd2 = "npm run test";
-        String buildCmd3 = "npm --registry http://registry.npm.taobao.org i && npm run test";
+        String buildCmd3 = "cd /app && npm --registry http://registry.npm.taobao.org i && npm run uat";
         String buildCmd4 = "npm --registry http://registry.npm.taobao.org i";
 
         Config config = new Config(image);
         config.setVolumes(new Volumes());
-        config.setCmd(List.of("sh", "-c", "cd /front && " + buildCmd));
+        config.setCmd(List.of("sh", "-c", buildCmd3));
 
         Map<String, String> map = config.getVolumes().getMap();
-        map.put(sourceCodeDir, "/front");
-        //map.put(nodeModulesDir, "/front/node_modules");
+        map.put("/node_modules", nodeModulesDir);
+        map.put("/app", sourceCodeDir);
 
         long start = 0;
-
-
         start = System.currentTimeMillis();
         docker.runAndRm(config);
         log.info("cost {} ms", System.currentTimeMillis()-start);