-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.gradle
79 lines (73 loc) · 2.27 KB
/
deploy.gradle
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
78
79
def microservices = [
project(':matrix-admin'),
project(':matrix-gateway'),
// project(':matrix-system:system-biz'),
// project(':matrix-resource:resource-biz')
]
switch (PROFILE) {
case 'dev':
ext {
//测试环境镜像仓库配置
registryUrl = ''
registryNamespace = ''
registryUsername = ''
registryPassword = ''
baseImage = 'amazoncorretto:17.0.8'
}
break
case 'prod':
ext {
//生产环境镜像仓库配置
registryUrl = ''
registryNamespace = ''
registryUsername = ''
registryPassword = ""
baseImage = 'amazoncorretto:17.0.8'
}
break
}
println "build services: ${microservices.name}"
println "build profile: $PROFILE"
File agentFile = file "./skywalking-agent"
configure(microservices) {
apply plugin: 'com.google.cloud.tools.jib'
jib {
from {
image = "${baseImage}"
}
//推送的目标镜像仓库地址
to {
image = "${registryUrl}/${registryNamespace}/${project.name}:${project.version}"
//身份认证信息
auth {
username = "${registryUsername}"
password = "${registryPassword}"
}
}
allowInsecureRegistries = true
//镜像容器的配置信息
container {
environment = [SW_AGENT_NAME: "${project.name}".toString()]
if (project.name == 'matrix-admin') {
jvmFlags = ['-Djava.security.egd=file:/dev/./urandom', '-Dfile.encoding=utf-8']
} else {
jvmFlags = ['-Djava.security.egd=file:/dev/./urandom', '-Dfile.encoding=utf-8', '-javaagent:/skywalking-agent/skywalking-agent.jar']
}
creationTime = "USE_CURRENT_TIMESTAMP"
volumes = ['/skywalking/agent']
}
//admin不增加agent探针
if (project.name == 'matrix-admin') {
return
}
//添加skyWalking agent探针
extraDirectories {
paths {
path {
from = agentFile
into = '/skywalking-agent'
}
}
}
}
}