Authored by qinchao

docker发布

... ... @@ -155,23 +155,32 @@ public class DockerProjectCtrl {
*/
@RequestMapping("/mirrorAndDeploy")
@ResponseBody
public BaseResponse mirrorAndDeploy(@RequestBody DockerJenkinsReq dockerJenkinsReq) {
public BaseResponse mirrorAndDeploy(@RequestBody DockerJenkinsReq dockerJenkinsReqOld) {
BaseResponse rtn=new BaseResponse<>();
String ids=dockerJenkinsReq.getProjectIds();
String ids=dockerJenkinsReqOld.getProjectIds();
String userMail=dockerJenkinsReqOld.getUserMail();
String branch=dockerJenkinsReqOld.getBranch();
String nodeEnv=dockerJenkinsReqOld.getNodeEnv();
StringBuilder buildIdSb=new StringBuilder();
StringBuilder failSb=new StringBuilder();
for(String id:ids.split(",")){
if(StringUtils.isNotBlank(id)){
DockerProjectModel model=dockerProjectMapper.selectById(Integer.parseInt(id));
if(model!=null){
//必须要new一个新的对象出来
DockerJenkinsReq dockerJenkinsReq=new DockerJenkinsReq();
dockerJenkinsReq.setProjectIds(id);
dockerJenkinsReq.setProjectName(model.getProjectName());
dockerJenkinsReq.setProjectJobType(model.getProjectJobType());
dockerJenkinsReq.setProjectGitGroup(model.getProjectGitGroup());
dockerJenkinsReq.setDeployName(model.getDockerProjectName());
dockerJenkinsReq.setUserMail(dockerJenkinsReq.getUserMail());
dockerJenkinsReq.setBranch(dockerJenkinsReq.getBranch());
dockerJenkinsReq.setNodeEnv(dockerJenkinsReq.getNodeEnv());
dockerJenkinsReq.setProjectPort(model.getPort());
//页面传过来的参数
dockerJenkinsReq.setUserMail(userMail);
dockerJenkinsReq.setBranch(branch);
dockerJenkinsReq.setNodeEnv(nodeEnv);
if(dockerJenkinsReq.getNodeEnv().toUpperCase().indexOf("GRAY")>=0){
dockerJenkinsReq.setImageSource(model.getDockerGrayImageStore());
dockerJenkinsReq.setClusterId(model.getDockerGrayClusterId());
... ...