Skip to content

Commit

Permalink
tomcat部署应用的访问路径
Browse files Browse the repository at this point in the history
  • Loading branch information
cgw committed Sep 18, 2023
1 parent d04154d commit a0371c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,11 @@ private void buildSpringBootImage(DeploymentContext context) {
for (File file : packageTargetPath.listFiles()) {
String packageFileType = PackageFileTypeEnum.getByCode(appExtend.getPackageFileType()).getValue();
if (file.getName().endsWith("." + packageFileType)) {
File targetFile = new File(file.getParent() + "/" + context.getApp().getAppName() + "." + packageFileType);
String fileName = context.getApp().getAppName();
if(PackageFileTypeEnum.WAR.getCode().equals(appExtend.getPackageFileType())) {
fileName = "ROOT";
}
File targetFile = new File(file.getParent() + "/" + fileName + "." + packageFileType);
file.renameTo(targetFile);
targetFiles.add(targetFile.toPath());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ private void initContainerOfWar(DeploymentContext context, List<V1Container> con
container.setImage(context.getFullNameOfImage());
container.setImagePullPolicy("Always");
container.setCommand(Arrays.asList("/bin/sh", "-c"));
String warFile = Constants.USR_LOCAL_HOME + context.getApp().getAppName() + "." + PackageFileTypeEnum.WAR.getValue();
String warFile = Constants.USR_LOCAL_HOME + "ROOT." + PackageFileTypeEnum.WAR.getValue();
container.setArgs(Arrays.asList("cp -rf " + warFile + " " + K8sUtils.TOMCAT_APP_PATH));

V1VolumeMount volumeMount = new V1VolumeMount();
Expand Down

0 comments on commit a0371c9

Please sign in to comment.