|
|
@ -37,7 +37,7 @@ public class PublishUtil {
|
|
|
|
* docker tag 19a54d2204aa registry.cn-hangzhou.aliyuncs.com/yltcharge/jdk:21
|
|
|
|
* docker tag 19a54d2204aa registry.cn-hangzhou.aliyuncs.com/yltcharge/jdk:21
|
|
|
|
* docker push registry.cn-hangzhou.aliyuncs.com/yltcharge/jdk:21
|
|
|
|
* docker push registry.cn-hangzhou.aliyuncs.com/yltcharge/jdk:21
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static void publish(String projectName, boolean isStatic, String workingPath, String localLibPath, Kv choiceWarehouse,String choiceConfig) throws Exception {
|
|
|
|
public static void publish(String projectName, boolean isStatic, String workingPath, String localLibPath, Kv choiceWarehouse, String choiceConfig) throws Exception {
|
|
|
|
System.out.println("正在生成" + projectName + "的镜像...");
|
|
|
|
System.out.println("正在生成" + projectName + "的镜像...");
|
|
|
|
//配置文件
|
|
|
|
//配置文件
|
|
|
|
String path = PathKit.getRootClassPath() + "\\publishImage.json";
|
|
|
|
String path = PathKit.getRootClassPath() + "\\publishImage.json";
|
|
|
@ -133,8 +133,9 @@ public class PublishUtil {
|
|
|
|
ssh.exec(cmd);
|
|
|
|
ssh.exec(cmd);
|
|
|
|
System.out.println("仓库登录成功!修改JDK21的引用镜像成功!");
|
|
|
|
System.out.println("仓库登录成功!修改JDK21的引用镜像成功!");
|
|
|
|
//修改镜像要用的配置文件
|
|
|
|
//修改镜像要用的配置文件
|
|
|
|
cmd="sed -i 's|ENV WORKING_ENV=\"pro\"|ENV WORKING_ENV=\""+choiceConfig+"\"|g'";
|
|
|
|
cmd = "sed -i 's|ENV WORKING_ENV=\"pro\"|ENV WORKING_ENV=\"" + choiceConfig + "\"|g' " + remoteDockerFile;
|
|
|
|
ssh.exec(cmd);
|
|
|
|
ssh.exec(cmd);
|
|
|
|
|
|
|
|
System.out.println(cmd);
|
|
|
|
System.out.println("环境变量修改成功!");
|
|
|
|
System.out.println("环境变量修改成功!");
|
|
|
|
|
|
|
|
|
|
|
|
//删除所有镜像
|
|
|
|
//删除所有镜像
|
|
|
@ -343,7 +344,7 @@ public class PublishUtil {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
System.out.println("项目" + projectBean.getDevProjectName() + "没有配置文件");
|
|
|
|
System.out.println("项目" + projectBean.getDevProjectName() + "没有配置文件");
|
|
|
|
System.exit(0);
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -359,7 +360,7 @@ public class PublishUtil {
|
|
|
|
|
|
|
|
|
|
|
|
int choice = scanner.nextInt(); // 读取用户输入的整数
|
|
|
|
int choice = scanner.nextInt(); // 读取用户输入的整数
|
|
|
|
if (choice >= 1 && choice <= setConfigFiles.size()) {
|
|
|
|
if (choice >= 1 && choice <= setConfigFiles.size()) {
|
|
|
|
return setConfigFiles.get(choice - 1);
|
|
|
|
return setConfigFiles.get(choice - 1).replace("application_", "").replace(".yaml", "");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
System.out.println("输入不正确,请输入1与 " + setConfigFiles.size() + "之间的数值!"); // 提示用户输入不正确
|
|
|
|
System.out.println("输入不正确,请输入1与 " + setConfigFiles.size() + "之间的数值!"); // 提示用户输入不正确
|
|
|
|
}
|
|
|
|
}
|
|
|
|