...
|
...
|
@@ -124,22 +124,48 @@ public class DockerBuildCtrl { |
|
|
|
|
|
/**
|
|
|
* 把node项目的az2区域切换到gray
|
|
|
*
|
|
|
* @env 发布环境 ,拦截器记录操作日志用
|
|
|
* @branch 分支 ,拦截器记录操作日志用
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/switchDockerNodeAz2")
|
|
|
@ResponseBody
|
|
|
public BaseResponse switchDockerNodeAz2(String project_name,String onlineOrGray) {
|
|
|
public BaseResponse switchDockerNodeAz2(String project_name,String onlineOrGray,String env,String branch) {
|
|
|
if(!"online".equals(onlineOrGray)&&!"gray".equals(onlineOrGray)){
|
|
|
return new BaseResponse(201,"不支持参数onlineOrGray:"+onlineOrGray);
|
|
|
}
|
|
|
String projectType;
|
|
|
String inGrayKey;
|
|
|
if("yohoblk-wap".equals(project_name)){
|
|
|
projectType="blk";
|
|
|
inGrayKey="inGray_blk";
|
|
|
}else if("yohobuywap-node".equals(project_name)){
|
|
|
projectType="wap";
|
|
|
inGrayKey="inGray_wap";
|
|
|
}else if("yohobuy-node".equals(project_name)){
|
|
|
projectType="pc";
|
|
|
inGrayKey="inGray_pc";
|
|
|
}else{
|
|
|
return new BaseResponse(201,"不支持参数:"+project_name);
|
|
|
}
|
|
|
|
|
|
BaseResponse queryStatusResponse=httpRestClient.defaultGet("/pch5DockerSwitch/getDockerElbStatus", BaseResponse.class);
|
|
|
if(queryStatusResponse!=null&&queryStatusResponse.getCode()==200){
|
|
|
Map<String,Object> resultMap=(Map<String,Object>)queryStatusResponse.getData();
|
|
|
if(resultMap.containsKey(inGrayKey)){
|
|
|
boolean inGray=(Boolean)resultMap.get(inGrayKey);
|
|
|
if("gray".equals(onlineOrGray)&&inGray){
|
|
|
//目标是切换到灰度,当前已经是灰度了,所以直接返回
|
|
|
return new BaseResponse();
|
|
|
}
|
|
|
|
|
|
if("online".equals(onlineOrGray)&&inGray==false){
|
|
|
//目标是切换到online,当前已经关闭灰度了,所以直接返回
|
|
|
return new BaseResponse();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Map map = new HashMap<>();
|
|
|
map.put("projectType",projectType);
|
|
|
map.put("onlineOrGray",onlineOrGray);
|
...
|
...
|
|