Authored by qinchao

docker发布

... ... @@ -9,7 +9,7 @@ public class DockerProjectModel {
private String projectName;
//项目类型
private String projectType;
private String projectJobType;
private String dockerProjectName;
... ...
... ... @@ -14,7 +14,7 @@ public class DockerJenkinsReq {
private String userName;
private String userMail;
private String releaseWorkId;
private String projectType;
private String projectJobType;
//docker qlcoud
... ...
... ... @@ -8,7 +8,7 @@ import java.util.Set;
public class ProjectEnvironment {
private static String[] dockerEnvironments = {"ONLINE-QCLOUD","GRAY-QCLOUD"};
private static String[] dockerProjectTypes = {"NODE","JAVA"};
private static String[] dockerProjectJobTypes = {"Docker-Deploy-Node","Docker-Deploy-Java"};
private static Map<String,String> map = new HashMap<>();
static{
... ... @@ -35,8 +35,8 @@ public class ProjectEnvironment {
return dockerEnvironments;
}
public static String[] getDockerProjectTypes(){
return dockerProjectTypes;
public static String[] getDockerProjectJobTypes(){
return dockerProjectJobTypes;
}
}
... ...
... ... @@ -38,7 +38,7 @@ public class DockerBuildCtrl {
}
model.addAttribute("environments", ProjectEnvironment.getDockerEnvironments());
model.addAttribute("projectTypes", ProjectEnvironment.getDockerProjectTypes());
model.addAttribute("projectJobTypes", ProjectEnvironment.getDockerProjectJobTypes());
return new ModelAndView("project/docker_project");
}
... ... @@ -49,11 +49,11 @@ public class DockerBuildCtrl {
*/
@RequestMapping(value = "/getProjects")
@ResponseBody
public String getProjects(String projectType) {
public String getProjects(String projectJobType) {
try {
Map map = new HashMap<>();
map.put("projectType",projectType);
BaseResponse response=httpRestClient.defaultGet("/dockerProject/getDockerProjectByType", BaseResponse.class, map);
map.put("projectJobType",projectJobType);
BaseResponse response=httpRestClient.defaultGet("/dockerProject/getDockerProjectByJobType", BaseResponse.class, map);
return JSONArray.toJSON(response.getData()).toString();
} catch (Exception ex) {
return "failed";
... ...
... ... @@ -250,7 +250,7 @@
type: 'POST',
dataType: 'json',
data:{
projectType:dockerProject.projectType,
projectJobType:dockerProject.projectJobType,
appNames:dockerProject.projectName,
nodeEnv:$("#environment_name").val(),
branch:$("#branch_name").val(),
... ...
... ... @@ -81,13 +81,13 @@
<label class="col-sm-1 control-label">项目类别</label>
<div class="col-sm-8">
<c:forEach items="${projectTypes }" var="projType" varStatus="projTypeStatus">
<c:forEach items="${projectJobTypes }" var="projJobType" varStatus="projJobTypeStatus">
<div class="rdio rdio-default">
<input type="radio" name="projectTypes" id="${projType }" value="${projType }"
<input type="radio" name="projectJobTypes" id="${projJobType }" value="${projJobType }"
onclick="getProjects()"
<c:if test="${projTypeStatus.index==0}">checked="checked"</c:if>
<c:if test="${projJobTypeStatus.index==0}">checked="checked"</c:if>
/>
<label for="${projType }">${projType }</label>
<label for="${projJobType }">${projJobType }</label>
</div>
</c:forEach>
</div>
... ... @@ -227,7 +227,7 @@
type: 'post',
url: contextPath + "dockerBuild/getProjects",
data: {
projectType:$("input[name='projectTypes']:checked").val()
projectJobType:$("input[name='projectJobTypes']:checked").val()
},
dataType: 'json',
success: function (data) {
... ...