...
|
...
|
@@ -15,12 +15,16 @@ import com.monitor.other.worksystem.contants.HandleType; |
|
|
import com.monitor.other.worksystem.contants.HandlerRole;
|
|
|
import com.monitor.other.worksystem.contants.WorkStatus;
|
|
|
import com.monitor.other.worksystem.contants.WorkType;
|
|
|
import com.monitor.other.worksystem.dock.FastJenkinsUtils;
|
|
|
import com.monitor.other.worksystem.service.ReleaseService;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
/**
|
|
|
* Created by zhengyouwei on 2016/9/2.
|
...
|
...
|
@@ -263,4 +267,34 @@ public class ReleaseServiceImpl implements ReleaseService { |
|
|
public int updateByTestId(String testId, String testMessage) {
|
|
|
return releaseWorkJobMapper.updateByTestId(testId, testMessage);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int jenkinsBuild(ReleaseWorkJob releaseWorkJob){
|
|
|
releaseWorkJob.setId("release0004377");
|
|
|
|
|
|
Map params= new HashMap();
|
|
|
params.put("appNames","yohoblk-wap");
|
|
|
params.put("branch","feature/docker");
|
|
|
params.put("nodeEnv","ONLINE-QCLOUD");
|
|
|
params.put("userMail","craig.qin@yoho.cn");
|
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
uuid=params.get("appNames")+"-"+uuid.replace("-", "");
|
|
|
params.put("ticketID", uuid);
|
|
|
|
|
|
//更新发布工单的jenkins_build_id
|
|
|
releaseWorkJobMapper.updateJenkinsBuildId(releaseWorkJob);
|
|
|
|
|
|
FastJenkinsUtils fastJenkinsUtils=new FastJenkinsUtils();
|
|
|
int jobId=fastJenkinsUtils.createJob(FastJenkinsUtils.JENKINS_JOB_NODE,params);
|
|
|
return jobId;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int jenkinsStatusUpdate(String ticketID,String status){
|
|
|
ReleaseWorkJob releaseWorkJob=new ReleaseWorkJob();
|
|
|
releaseWorkJob.setJenkinsBuildId(ticketID);
|
|
|
releaseWorkJob.setJenkinsBuildStatus(status);
|
|
|
return releaseWorkJobMapper.updateJenkinsBuildStatus(releaseWorkJob);
|
|
|
}
|
|
|
} |
...
|
...
|
|