Authored by jack

Merge branch 'master' of http://git.yoho.cn/ops/monitor-service

... ... @@ -19,4 +19,10 @@ public interface Constants {
String DNS_SCRIPT = "dns_nginx.sh";
String ZIXUN_SCRIPT = "zixun_nginx.sh";
String MARS_SCRIPT = "mars_nginx.sh";
String GLOBAL_SCRIPT = "global_nginx.sh";
}
... ...
... ... @@ -87,6 +87,18 @@ public class NginxSyncService {
cmdTaskInfo.setCmd("/bin/bash " + Constants.SCRIPT_PATH + Constants.DNS_SCRIPT + args);
break;
case 4:
cmdTaskInfo.setCmd("/bin/bash " + Constants.SCRIPT_PATH + Constants.ZIXUN_SCRIPT + args);
break;
case 5:
cmdTaskInfo.setCmd("/bin/bash " + Constants.SCRIPT_PATH + Constants.MARS_SCRIPT + args);
break;
case 6:
cmdTaskInfo.setCmd("/bin/bash " + Constants.SCRIPT_PATH + Constants.GLOBAL_SCRIPT + args);
break;
default:
break;
}
... ...
... ... @@ -40,20 +40,23 @@ public class ReleaseRollBack {
public void releaseRollBack() {
try {
List<ReleaseWorkJob> list = releaseWorkJobMapper.selectForTask();
for (ReleaseWorkJob releaseWorkJob : list){
if (!"JAVA".equals(releaseWorkJob.getPlatform())){
for (ReleaseWorkJob releaseWorkJob : list) {
if (!"JAVA".equals(releaseWorkJob.getPlatform())) {
continue;
}
String[] environments = releaseWorkJob.getEnvironment().split(",");
String[] projects = releaseWorkJob.getProject().split(",");
for (String environment : environments){
for (String project : projects){
for (String environment : environments) {
if ("qcloud_gray".equals(environment)) {
continue;
}
for (String project : projects) {
Map<String, String> map = new HashMap<>();
map.put("project", project);
map.put("environment", environment);
String rollbackJson = httpRestClientService.doGet(url+ "rollbackList", map);
if (rollbackJson != null && !"failed".equals(rollbackJson)){
List<String> rollbackList = JSONArray.parseArray(rollbackJson,String.class);
String rollbackJson = httpRestClientService.doGet(url + "rollbackList", map);
if (rollbackJson != null && !"failed".equals(rollbackJson)) {
List<String> rollbackList = JSONArray.parseArray(rollbackJson, String.class);
BuildRequest buildRequest = new BuildRequest();
buildRequest.setUser("aotoRollback");
buildRequest.setEnvironment(environment);
... ... @@ -65,13 +68,14 @@ public class ReleaseRollBack {
}
}
if (!"qcloud_gray".equals(releaseWorkJob.getEnvironment())){
releaseWorkJob.setStatus(WorkStatus.AUTO_ROLLBACK);
releaseWorkJobMapper.updateRollback(releaseWorkJob);
workSystemSupport.workend(releaseWorkJob.getId(), WorkType.RELEASE_PROJECT,releaseWorkJob.getTitle(),WorkStatus.getCstatus(WorkStatus.AUTO_ROLLBACK));
workSystemSupport.workend(releaseWorkJob.getId(), WorkType.RELEASE_PROJECT, releaseWorkJob.getTitle(), WorkStatus.getCstatus(WorkStatus.AUTO_ROLLBACK));
}
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
}
... ...
... ... @@ -5,6 +5,9 @@ datasources:
- 172.31.50.75:3306
username: ops
password: t5/oMgwUCmO/GeMHBAQ2Cg==
maxConnections: 50
minIdle: 10
maxIdle: 50
zabbix:
servers:
... ... @@ -12,6 +15,9 @@ datasources:
- 10.66.0.191:3306
username: zabbix_ops
password: YQ7VlkwN1Mum/fjaZARkKg==
maxConnections: 50
minIdle: 10
maxIdle: 50
daos:
- com.monitor.zabbix.mapper.ZabbixHistoryMapper
- com.monitor.zabbix.mapper.ZabbixHostMapper
... ...
... ... @@ -60,6 +60,10 @@
<logger name="com.yoho.core.dal.datasource.intercepor.DaoInterceptor" level="ERROR"></logger>
<logger name="net.rubyeye.xmemcached.XMemcachedClient" level="ERROR"></logger>
<logger name="com.google.code.yanf4j.core.impl.AbstractController" level="ERROR"></logger>
<!-- root级别 DEBUG -->
<root level="INFO">
<!-- 文件输出 -->
... ...