main
黄海 10 months ago
parent 5bfff761bb
commit 19644e5226

@ -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() + "之间的数值!"); // 提示用户输入不正确
} }

@ -23,7 +23,10 @@ public class GwApplication extends JFinalConfig {
*/ */
public static String getEnvPrefix() { public static String getEnvPrefix() {
String myEnvVar = System.getenv("WORKING_ENV"); String myEnvVar = System.getenv("WORKING_ENV");
return myEnvVar == null ? "dev" : "pro"; if (myEnvVar == null) {
myEnvVar = "dev";
}
return myEnvVar;
} }
public static void main(String[] args) { public static void main(String[] args) {

@ -0,0 +1,23 @@
# 上传文件的临时路径
uploadTempPath: /tmp
# JWT
SECRET: ZXZnZWVr5b+r5LmQ5L2g55qE5Ye66KGM
# 生成Token的密码
CookieMd5SingPwd: DsideaL4r5t6y7u
# 路由
route:
# 基础数据
dsBase:
url: http://ds-base:8001
# 资源库
dsRes:
url: http://ds-res:8002
# 白名单
whitelist:
# 全局变量获取
- /dsBase/global/getGlobalValueByKey
# 登录
- /dsBase/loginPerson/doLogin
Loading…
Cancel
Save