|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package Util;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
|
|
import cn.hutool.core.io.file.PathUtil;
|
|
|
|
|
import cn.hutool.core.util.ZipUtil;
|
|
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
|
@ -143,19 +142,19 @@ public class PublishUtil {
|
|
|
|
|
System.out.println("镜像打包完成,镜像ID=" + imageId);
|
|
|
|
|
|
|
|
|
|
//登录镜像仓库
|
|
|
|
|
cmd = "docker login --username=驿来特充电 --password=ylt5033. registry.cn-hangzhou.aliyuncs.com";
|
|
|
|
|
cmd = "docker login --username=东师黄海 --password=DsideaL4r5t6y7u registry.cn-hangzhou.aliyuncs.com";
|
|
|
|
|
ssh.exec(cmd);
|
|
|
|
|
System.out.println("仓库登录成功!");
|
|
|
|
|
|
|
|
|
|
System.out.println("打标签...");
|
|
|
|
|
cmd = "docker tag " + imageId + " registry.cn-hangzhou.aliyuncs.com/yltcharge/" + projectName + ":" + newVersion;
|
|
|
|
|
cmd = "docker tag " + imageId + " registry.cn-hangzhou.aliyuncs.com/dsideal/" + projectName + ":" + newVersion;
|
|
|
|
|
ssh.exec(cmd);
|
|
|
|
|
|
|
|
|
|
// System.out.println("开始推送到远程仓库,稍等...");
|
|
|
|
|
// cmd = "docker push registry.cn-hangzhou.aliyuncs.com/yltcharge/" + projectName + ":" + newVersion;
|
|
|
|
|
// ssh.exec(cmd);
|
|
|
|
|
//
|
|
|
|
|
// System.out.println("推送到远程仓库完成!");
|
|
|
|
|
System.out.println("开始推送到远程仓库,稍等...");
|
|
|
|
|
cmd = "docker push registry.cn-hangzhou.aliyuncs.com/dsideal/" + projectName + ":" + newVersion;
|
|
|
|
|
ssh.exec(cmd);
|
|
|
|
|
|
|
|
|
|
System.out.println("推送到远程仓库完成!");
|
|
|
|
|
|
|
|
|
|
ssh.disconnect();
|
|
|
|
|
System.out.println("恭喜,镜像打包成功!");
|
|
|
|
|