-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdrone-email.html
175 lines (164 loc) · 6.42 KB
/
drone-email.html
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>服务构建部署通知</title>
<style>
body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
/*-------------------------------------------------------------------*/
.info {
color: #1890ff;
}
.success {
color: #52c41a;
}
.warning {
color: #faad14;
}
.error {
color: #f5222d;
}
.status-success {
color: #ffffff;
background-color: #52c41a;
}
.status-error {
color: #ffffff;
background-color: #f5222d;
}
/*-------------------------------------------------------------------*/
.info-table {
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
/*border-top: 2px solid #B0CBE2;*/
/*border-bottom: 2px solid #B0CBE2;*/
/*font-size: 12px;*/
width: 100%;
}
.info-table tbody {
display: table-row-group;
vertical-align: middle;
border-color: inherit;
}
.info-table tbody td, th {
border: 1px solid #B0CBE2;
padding: 8px 16px;
text-align: left;
}
.info-table .table-label {
padding-left: 0;
font-weight: bold;
color: rgba(0, 0, 0, 0.55);
width: 150px;
text-align: center;
background-color: #D5E7F3;
}
.info-table .table-value {
/*font-size: 12px;*/
text-align: left;
}
</style>
</head>
<body>
<div style="width: 100%;text-align: center;margin-top: 32px;">
<div style="display: inline-block;border: 1px solid #B0CBE2;padding: 12px 32px 8px 32px;">
<div style="font-size: 20px;font-weight: bold;margin: 8px auto 12px;" class="{{build.status}}">
<span>[{{repo.name}}]</span>
<span>构建部署成功</span>
</div>
<table class="info-table" style="width: 800px;">
<!--<tr>-->
<!--<td colspan="2" class="table-label" style="background-color: white;color: #1890ff;">-->
<!----------------< 构建部署信息 >---------------->
<!--</td>-->
<!--</tr>-->
<tr>
<td class="table-label">当前构建次数</td>
<td class="table-value">
<span>{{build.number}}次</span>
<a href="{{build.link}}" target="_blank" style="margin-left: 8px;">构建日志</a>
</td>
</tr>
<tr>
<td class="table-label">构建状态</td>
<td class="table-value">
<span class="status-{{build.status}}" style="border-radius:5px;display: inline-block;padding: 0 6px 3px 6px;">{{build.status}}</span>
</td>
</tr>
<tr>
<td class="table-label">构建时间</td>
<td class="table-value">
{{datetime build.started "2006年1月2日 15:04:05" "Asia/Shanghai"}} ~ {{datetime build.finished "2006年1月2日 15:04:05" "Asia/Shanghai"}}
</td>
</tr>
<tr>
<td class="table-label">触发构建事件</td>
<td class="table-value">{{build.event}}</td>
</tr>
<!--<tr>-->
<!--<td colspan="2" class="table-label" style="background-color: white;color: #1890ff;">-->
<!----------------< 项目仓库信息 >---------------->
<!--</td>-->
<!--</tr>-->
<tr>
<td class="table-label">项目名称</td>
<td class="table-value">
<a href="{{remote.URL}}" target="_blank">{{repo.fullName}}</a>
</td>
</tr>
<tr>
<td class="table-label">项目分支</td>
<td class="table-value">{{repo.branch}}</td>
</tr>
<tr>
<td class="table-label">项目地址</td>
<td class="table-value">
<a href="{{remote.URL}}" target="_blank">{{remote.URL}}</a>
</td>
</tr>
<tr>
<td class="table-label">项目作者</td>
<td class="table-value">{{repo.owner}}</td>
</tr>
<tr>
<td class="table-label">是否开源</td>
<td class="table-value">{{repo.private}}</td>
</tr>
<tr>
<td class="table-label">是否受信任</td>
<td class="table-value">{{repo.trusted}}</td>
</tr>
<!--<tr>-->
<!--<td colspan="2" class="table-label" style="background-color: white;color: #1890ff;">-->
<!----------------< 项目提交信息 >---------------->
<!--</td>-->
<!--</tr>-->
<tr>
<td class="table-label">提交代码分支</td>
<td class="table-value">{{commit.branch}} [{{commit.ref}}]</td>
</tr>
<tr>
<td class="table-label">提交记录</td>
<td class="table-value">
<a href="{{commit.link}}" target="_blank">{{commit.message}}</a>
</td>
</tr>
<tr>
<td class="table-label">提交人姓名</td>
<td class="table-value">
<img src="{{commit.author.avatar}}" alt="avatar" style="width: 16px;height: 16px;margin-right: 1px;position: relative;bottom: -3px;">
{{commit.author.name}} [{{commit.author.email}}]
</td>
</tr>
<tr>
<td class="table-label">创建Git Tag</td>
<td class="table-value">{{tag}}</td>
</tr>
</table>
</div>
</div>
</body>
</html>