Authored by qinchao

发布-通告镜像-

@@ -43,11 +43,21 @@ public class ReleaseWorkJob { @@ -43,11 +43,21 @@ public class ReleaseWorkJob {
43 private String project; 43 private String project;
44 44
45 /** 45 /**
  46 + * 发布方式:git分支,image镜像文件
  47 + */
  48 + private String projectDeployType;
  49 +
  50 + /**
46 * 分支 51 * 分支
47 */ 52 */
48 private String branch; 53 private String branch;
49 54
50 /** 55 /**
  56 + * 镜像文件名称
  57 + */
  58 + private String imageFile;
  59 +
  60 + /**
51 * 敏感接口 61 * 敏感接口
52 */ 62 */
53 private String sensitiveInterface; 63 private String sensitiveInterface;
@@ -29,8 +29,8 @@ public class ProjectEnvironment { @@ -29,8 +29,8 @@ public class ProjectEnvironment {
29 dockerProjectTypeMap.put("ops","ops"); 29 dockerProjectTypeMap.put("ops","ops");
30 dockerProjectTypeMap.put("erp","erp"); 30 dockerProjectTypeMap.put("erp","erp");
31 31
32 - projectDeployTypeMap.put("git","Git分支");  
33 - projectDeployTypeMap.put("image","Docker镜像"); 32 + projectDeployTypeMap.put("git","git分支");
  33 + projectDeployTypeMap.put("image","镜像文件");
34 34
35 } 35 }
36 36
@@ -576,10 +576,10 @@ @@ -576,10 +576,10 @@
576 function addReleaseJob() { 576 function addReleaseJob() {
577 var title = $("input[name='title']").val(); 577 var title = $("input[name='title']").val();
578 var demand = $("textarea[name='demand']").val(); 578 var demand = $("textarea[name='demand']").val();
579 - var platform = $('input:radio[name=platform]:checked').val();  
580 - var envuronments = ""; 579 +
  580 + var environments = "";
581 $('input[name="environment"]:checked').each(function () { 581 $('input[name="environment"]:checked').each(function () {
582 - envuronments = envuronments + "," + $(this).val();//向数组中添加元素 582 + environments = environments + "," + $(this).val();//向数组中添加元素
583 }); 583 });
584 var project = ""; 584 var project = "";
585 $('input[name="project"]:checked').each(function () { 585 $('input[name="project"]:checked').each(function () {
@@ -606,7 +606,7 @@ @@ -606,7 +606,7 @@
606 localAlert("参数错误", "请选择平台"); 606 localAlert("参数错误", "请选择平台");
607 return; 607 return;
608 } 608 }
609 - if (envuronments.length == 0) { 609 + if (environments.length == 0) {
610 localAlert("参数错误", "请选择环境"); 610 localAlert("参数错误", "请选择环境");
611 return; 611 return;
612 } 612 }
@@ -618,13 +618,33 @@ @@ -618,13 +618,33 @@
618 localAlert("参数错误", "请选择测试"); 618 localAlert("参数错误", "请选择测试");
619 return; 619 return;
620 } 620 }
  621 +
  622 + //发布方式
  623 + var projectDeployType=$("#projectDeployType").val();
  624 + if(projectDeployType=="git"){
  625 + if(!$("#inputBranch").val()){
  626 + localAlert("参数错误", "请选择git分支");
  627 + return;
  628 + }
  629 + }else if(projectDeployType=="image"){
  630 + if(!$("#imagesList").val()){
  631 + localAlert("参数错误", "请选择镜像文件");
  632 + return;
  633 + }
  634 + }else{
  635 + localAlert("参数错误", "请选择发布方式");
  636 + return;
  637 + }
  638 +
621 var param = { 639 var param = {
622 title: title, 640 title: title,
623 demand: demand, 641 demand: demand,
624 platform: platform, 642 platform: platform,
625 - environment: envuronments, 643 + environment: environments,
626 project: project, 644 project: project,
  645 + projectDeployType:projectDeployType,
627 branch:$("#inputBranch").val(), 646 branch:$("#inputBranch").val(),
  647 + imageFile:$("#imagesList").val(),
628 sensitiveInterface: $("#sensitiveInterface").val(), 648 sensitiveInterface: $("#sensitiveInterface").val(),
629 testProject: testProject, 649 testProject: testProject,
630 projectType:$("input[name='projectTypes']:checked").val(), 650 projectType:$("input[name='projectTypes']:checked").val(),
@@ -107,14 +107,30 @@ @@ -107,14 +107,30 @@
107 </div> 107 </div>
108 </div> 108 </div>
109 109
110 - <div class="form-group">  
111 - <label class="col-sm-6 control-label"><strong>分支:</strong></label>  
112 - <div class="col-sm-8">  
113 - <input type="text" class="form-control" value=" ${workJob.branch}"  
114 - style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '  
115 - readonly="readonly"/>  
116 - </div>  
117 - </div> 110 + <c:choose>
  111 + <c:when test="${workJob.projectDeployType == 'image'}">
  112 + <div class="form-group">
  113 + <label class="col-sm-6 control-label"><strong>镜像文件:</strong></label>
  114 + <div class="col-sm-8">
  115 + <input type="text" class="form-control" value=" ${workJob.imageFile}"
  116 + style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
  117 + readonly="readonly"/>
  118 + </div>
  119 + </div>
  120 + </c:when>
  121 +
  122 + <c:otherwise>
  123 + <div class="form-group">
  124 + <label class="col-sm-6 control-label"><strong>分支:</strong></label>
  125 + <div class="col-sm-8">
  126 + <input type="text" class="form-control" value=" ${workJob.branch}"
  127 + style='border-left:0px;border-top:0px;border-right:0px;border-bottom:1px '
  128 + readonly="readonly"/>
  129 + </div>
  130 + </div>
  131 + </c:otherwise>
  132 + </c:choose>
  133 +
118 134
119 <div class="form-group"> 135 <div class="form-group">
120 <label class="col-sm-6 control-label"><strong>敏感接口:</strong></label> 136 <label class="col-sm-6 control-label"><strong>敏感接口:</strong></label>