ProjectEnvironment.java
2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.ui.project;
import com.ui.contants.ProjectConstant;
import java.util.*;
public class ProjectEnvironment {
//private static String[] dockerProjectTypes = {"node","java","php","ops","other"};
private static Map<String,String> map = new HashMap<>();
//docker相关
private static Map<String,String> dockerProjectTypeMap=new LinkedHashMap<>();
//项目发布的方式
private static Map<String,String> projectDeployTypeMap=new LinkedHashMap<>();
static{
map.put("aws", "http://"+ ProjectConstant.DEPLOY_IP+":8883/web/");
map.put("qcloud","http://"+ ProjectConstant.DEPLOY_IP+":8883/web/");
map.put("qcloud_gray","http://"+ ProjectConstant.DEPLOY_IP+":8883/web/");
map.put("aws_gray","http://"+ ProjectConstant.DEPLOY_IP+":8883/web/");
initDockerProjectTypeMap();
projectDeployTypeMap.put("git","git分支");
projectDeployTypeMap.put("image","镜像文件");
}
private static void initDockerProjectTypeMap() {
dockerProjectTypeMap.put("web","web");
dockerProjectTypeMap.put("media","media");
dockerProjectTypeMap.put("java","java");
dockerProjectTypeMap.put("ops","ops");
dockerProjectTypeMap.put("erp","erp");
dockerProjectTypeMap.put("jenkins-deploy","jenkins-deploy");
}
public static String getUrl(String envi){
if(map.containsKey(envi)){
return map.get(envi);
}else{
return "http://"+ ProjectConstant.DEPLOY_IP+":8883/web/";
}
}
public static List<String> getDockerEnvironments(String projectName) {
if (projectName == null
|| projectName.contains("yohobuywap-node")
|| projectName.contains("yoho-community-web")
|| projectName.contains("yohobuy-node")
|| projectName.contains("ufo-app-web")
|| projectName.contains("yoho-app-web")
|| projectName.contains("ultrainBlockApi")
|| projectName.contains("yohobuywap-node-activity")
|| projectName.contains("xianyu-ufo-app-web")
|| projectName.contains("xianyuservice")
|| projectName.contains("yoho-shop-manage")) {
return Arrays.asList("yoho-online","yoho-gray");
} else {
return Arrays.asList("yoho-online");
}
}
public static Map<String,String> getDockerProjectTypeMap(){
return dockerProjectTypeMap;
}
public static Map<String,String> getProjectDeployTypeMap(){
return projectDeployTypeMap;
}
}