|
|
|
@ -109,16 +109,21 @@ public class PublishUtil {
|
|
|
|
|
System.out.println("镜像打包完成,镜像ID=" + imageId);
|
|
|
|
|
|
|
|
|
|
//登录镜像仓库
|
|
|
|
|
cmd = "docker login --username=东师黄海 --password=DsideaL4r5t6y7u registry.cn-hangzhou.aliyuncs.com";
|
|
|
|
|
//cmd = "docker login --username=东师黄海 --password=DsideaL4r5t6y7u registry.cn-hangzhou.aliyuncs.com";
|
|
|
|
|
cmd = "docker login --username=驿来特充电 --password=ylt5033. registry.cn-hangzhou.aliyuncs.com";
|
|
|
|
|
System.out.println(cmd);
|
|
|
|
|
ssh.exec(cmd);
|
|
|
|
|
System.out.println("仓库登录成功!");
|
|
|
|
|
|
|
|
|
|
System.out.println("打标签...");
|
|
|
|
|
cmd = "docker tag " + imageId + " registry.cn-hangzhou.aliyuncs.com/dsideal/" + projectName + ":" + newVersion;
|
|
|
|
|
//cmd = "docker tag " + imageId + " registry.cn-hangzhou.aliyuncs.com/dsideal/" + projectName + ":" + newVersion;
|
|
|
|
|
cmd = "docker tag " + imageId + " registry.cn-hangzhou.aliyuncs.com/yltcharge/" + projectName + ":" + newVersion;
|
|
|
|
|
ssh.exec(cmd);
|
|
|
|
|
|
|
|
|
|
System.out.println("开始推送到远程仓库,稍等...");
|
|
|
|
|
cmd = "docker push registry.cn-hangzhou.aliyuncs.com/dsideal/" + projectName + ":" + newVersion;
|
|
|
|
|
//cmd = "docker push registry.cn-hangzhou.aliyuncs.com/dsideal/" + projectName + ":" + newVersion;
|
|
|
|
|
cmd = "docker push registry.cn-hangzhou.aliyuncs.com/yltcharge/" + projectName + ":" + newVersion;
|
|
|
|
|
System.out.println(cmd);
|
|
|
|
|
ssh.exec(cmd);
|
|
|
|
|
|
|
|
|
|
System.out.println("推送到远程仓库完成!");
|
|
|
|
|