|
@@ -1,6 +1,5 @@
|
|
|
package devops;
|
|
package devops;
|
|
|
|
|
|
|
|
-import cn.reghao.bnt.common.msg.constant.PackType;
|
|
|
|
|
import cn.reghao.bnt.web.WebApplication;
|
|
import cn.reghao.bnt.web.WebApplication;
|
|
|
import cn.reghao.bnt.web.devops.aliyun.service.AliyunOss;
|
|
import cn.reghao.bnt.web.devops.aliyun.service.AliyunOss;
|
|
|
import cn.reghao.bnt.web.devops.app.db.repository.AppBuildingRepository;
|
|
import cn.reghao.bnt.web.devops.app.db.repository.AppBuildingRepository;
|
|
@@ -77,32 +76,6 @@ public class AppConfigTest {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 构建应用依赖的 docker image
|
|
|
|
|
- *
|
|
|
|
|
- * @param
|
|
|
|
|
- * @return
|
|
|
|
|
- * @date 2025-10-13 16:19:21
|
|
|
|
|
- */
|
|
|
|
|
- @Test
|
|
|
|
|
- public void getDockerImageTest() {
|
|
|
|
|
- Set<String> dockerImages = configRepository.findAll().stream()
|
|
|
|
|
- .filter(appConfig -> appConfig.getPackerConfig().getType().equals(PackType.docker.getName()))
|
|
|
|
|
- .map(appConfig -> {
|
|
|
|
|
- String dockerfile = appConfig.getDockerfile();
|
|
|
|
|
- String[] lines = dockerfile.split(System.lineSeparator());
|
|
|
|
|
- for (String line : lines) {
|
|
|
|
|
- if (line.toLowerCase(Locale.ROOT).startsWith("from")) {
|
|
|
|
|
- String[] arr = line.split(" ");
|
|
|
|
|
- return arr[1].replace("\r", "");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return null;
|
|
|
|
|
- })
|
|
|
|
|
- .filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
|
|
- System.out.println();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
BuildLogRepository buildLogRepository;
|
|
BuildLogRepository buildLogRepository;
|
|
|
@Test
|
|
@Test
|