391 lines
12 KiB
HTML
391 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Jenkins构建成功通知</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
|
|
}
|
|
|
|
body {
|
|
background-color: #f5f7fa;
|
|
color: #333;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.email-container {
|
|
max-width: 600px;
|
|
margin: 20px auto;
|
|
background: #ffffff;
|
|
border-radius: 10px;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.email-header {
|
|
background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
|
|
color: white;
|
|
padding: 25px 30px;
|
|
text-align: center;
|
|
}
|
|
|
|
.email-header h1 {
|
|
font-size: 24px;
|
|
margin-bottom: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.status-badge {
|
|
display: inline-block;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
padding: 5px 15px;
|
|
border-radius: 20px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
.email-body {
|
|
padding: 25px 30px;
|
|
}
|
|
|
|
.section {
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 18px;
|
|
color: #4CAF50;
|
|
margin-bottom: 15px;
|
|
padding-bottom: 8px;
|
|
border-bottom: 2px solid #f0f0f0;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.info-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 15px;
|
|
}
|
|
|
|
.info-item {
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.info-label {
|
|
font-weight: 600;
|
|
color: #666;
|
|
font-size: 14px;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.info-value {
|
|
font-size: 15px;
|
|
color: #333;
|
|
word-break: break-word;
|
|
}
|
|
|
|
.deployment-details {
|
|
background: #f9f9f9;
|
|
border-left: 4px solid #4CAF50;
|
|
padding: 15px;
|
|
border-radius: 4px;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.server-list {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.server-item {
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid #eee;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.server-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
/* 构建时间线样式 */
|
|
.timeline {
|
|
position: relative;
|
|
margin: 20px 0;
|
|
}
|
|
|
|
.timeline::before {
|
|
content: '';
|
|
position: absolute;
|
|
left: 20px;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 2px;
|
|
background: #4CAF50;
|
|
}
|
|
|
|
.timeline-item {
|
|
position: relative;
|
|
margin-bottom: 20px;
|
|
padding-left: 50px;
|
|
}
|
|
|
|
.timeline-marker {
|
|
position: absolute;
|
|
left: 12px;
|
|
top: 0;
|
|
width: 18px;
|
|
height: 18px;
|
|
border-radius: 50%;
|
|
background: #4CAF50;
|
|
border: 3px solid white;
|
|
box-shadow: 0 0 0 2px #4CAF50;
|
|
z-index: 1;
|
|
}
|
|
|
|
.timeline-content {
|
|
background: #f8f9fa;
|
|
padding: 15px;
|
|
border-radius: 6px;
|
|
border-left: 3px solid #4CAF50;
|
|
}
|
|
|
|
.timeline-title {
|
|
font-weight: 600;
|
|
margin-bottom: 5px;
|
|
color: #333;
|
|
}
|
|
|
|
.timeline-time {
|
|
font-size: 13px;
|
|
color: #666;
|
|
}
|
|
|
|
.timeline-duration {
|
|
font-size: 12px;
|
|
color: #4CAF50;
|
|
margin-top: 5px;
|
|
}
|
|
|
|
.action-buttons {
|
|
text-align: center;
|
|
margin-top: 25px;
|
|
}
|
|
|
|
.btn {
|
|
display: inline-block;
|
|
padding: 10px 20px;
|
|
background: #4CAF50;
|
|
color: white;
|
|
text-decoration: none;
|
|
border-radius: 5px;
|
|
font-weight: 600;
|
|
margin: 0 5px;
|
|
transition: background 0.3s;
|
|
}
|
|
|
|
.btn:hover {
|
|
background: #45a049;
|
|
}
|
|
|
|
.btn-outline {
|
|
background: transparent;
|
|
border: 1px solid #4CAF50;
|
|
color: #4CAF50;
|
|
}
|
|
|
|
.btn-outline:hover {
|
|
background: #f0f9f0;
|
|
}
|
|
|
|
.email-footer {
|
|
background: #f0f2f5;
|
|
padding: 20px 30px;
|
|
text-align: center;
|
|
font-size: 13px;
|
|
color: #666;
|
|
border-top: 1px solid #eaeaea;
|
|
}
|
|
|
|
.footer-links {
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.footer-links a {
|
|
color: #4CAF50;
|
|
text-decoration: none;
|
|
margin: 0 10px;
|
|
}
|
|
|
|
.footer-links a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
.email-container {
|
|
margin: 10px;
|
|
border-radius: 0;
|
|
}
|
|
|
|
.info-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.timeline::before {
|
|
left: 15px;
|
|
}
|
|
|
|
.timeline-item {
|
|
padding-left: 40px;
|
|
}
|
|
|
|
.timeline-marker {
|
|
left: 8px;
|
|
width: 14px;
|
|
height: 14px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="email-container">
|
|
<div class="email-header">
|
|
<h1>✅ Jenkins构建成功</h1>
|
|
<p>您的项目已成功构建并部署</p>
|
|
<div class="status-badge">构建 #${BUILD_NUMBER} 成功</div>
|
|
</div>
|
|
|
|
<div class="email-body">
|
|
<div class="section">
|
|
<h2 class="section-title">📊 构建概览</h2>
|
|
<div class="info-grid">
|
|
<div class="info-item">
|
|
<div class="info-label">项目名称</div>
|
|
<div class="info-value">${JOB_NAME}</div>
|
|
</div>
|
|
<div class="info-item">
|
|
<div class="info-label">构建编号</div>
|
|
<div class="info-value">#${BUILD_NUMBER}</div>
|
|
</div>
|
|
<div class="info-item">
|
|
<div class="info-label">分支</div>
|
|
<div class="info-value">${BRANCH_NAME}</div>
|
|
</div>
|
|
<div class="info-item">
|
|
<div class="info-label">环境</div>
|
|
<div class="info-value">${PROFILES}</div>
|
|
</div>
|
|
<div class="info-item">
|
|
<div class="info-label">构建时间</div>
|
|
<div class="info-value">${BUILD_TIMESTAMP}</div>
|
|
</div>
|
|
<div class="info-item">
|
|
<div class="info-label">构建时长</div>
|
|
<div class="info-value">${BUILD_DURATION}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h2 class="section-title">⏱️ 构建时间线</h2>
|
|
<div class="timeline">
|
|
<div class="timeline-item">
|
|
<div class="timeline-marker"></div>
|
|
<div class="timeline-content">
|
|
<div class="timeline-title">代码检出</div>
|
|
<div class="timeline-time">${SCM_CHECKOUT_TIME}</div>
|
|
<div class="timeline-duration">耗时: ${SCM_CHECKOUT_DURATION}</div>
|
|
</div>
|
|
</div>
|
|
<div class="timeline-item">
|
|
<div class="timeline-marker"></div>
|
|
<div class="timeline-content">
|
|
<div class="timeline-title">依赖安装</div>
|
|
<div class="timeline-time">${DEPENDENCY_INSTALL_TIME}</div>
|
|
<div class="timeline-duration">耗时: ${DEPENDENCY_INSTALL_DURATION}</div>
|
|
</div>
|
|
</div>
|
|
<div class="timeline-item">
|
|
<div class="timeline-marker"></div>
|
|
<div class="timeline-content">
|
|
<div class="timeline-title">代码编译</div>
|
|
<div class="timeline-time">${COMPILE_TIME}</div>
|
|
<div class="timeline-duration">耗时: ${COMPILE_DURATION}</div>
|
|
</div>
|
|
</div>
|
|
<div class="timeline-item">
|
|
<div class="timeline-marker"></div>
|
|
<div class="timeline-content">
|
|
<div class="timeline-title">镜像构建</div>
|
|
<div class="timeline-time">${IMAGE_BUILD_TIME}</div>
|
|
<div class="timeline-duration">耗时: ${IMAGE_BUILD_DURATION}</div>
|
|
</div>
|
|
</div>
|
|
<div class="timeline-item">
|
|
<div class="timeline-marker"></div>
|
|
<div class="timeline-content">
|
|
<div class="timeline-title">部署执行</div>
|
|
<div class="timeline-time">${DEPLOY_TIME}</div>
|
|
<div class="timeline-duration">耗时: ${DEPLOY_DURATION}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section">
|
|
<h2 class="section-title">🚀 部署信息</h2>
|
|
<div class="info-item">
|
|
<div class="info-label">服务名称</div>
|
|
<div class="info-value">${SERVICE_NAME}</div>
|
|
</div>
|
|
<div class="info-item">
|
|
<div class="info-label">镜像标签</div>
|
|
<div class="info-value">${IMAGE_TAG}</div>
|
|
</div>
|
|
<div class="info-item">
|
|
<div class="info-label">部署策略</div>
|
|
<div class="info-value">${DEPLOYMENT_STRATEGY}</div>
|
|
</div>
|
|
|
|
<div class="deployment-details">
|
|
<div class="info-label">目标服务器</div>
|
|
<ul class="server-list">
|
|
<li class="server-item">
|
|
<span>服务器名称</span>
|
|
<span>状态</span>
|
|
</li>
|
|
${SERVER_LIST}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="action-buttons">
|
|
<a href="${BUILD_URL}" class="btn">查看构建详情</a>
|
|
<a href="${JOB_URL}" class="btn btn-outline">返回项目</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="email-footer">
|
|
<p>此邮件由 Jenkins CI/CD 系统自动发送,请勿直接回复。</p>
|
|
<div class="footer-links">
|
|
<a href="${JENKINS_URL}">Jenkins首页</a> |
|
|
<a href="${JOB_URL}/configure">配置通知</a> |
|
|
<a href="mailto:${ADMIN_EMAIL}?subject=Jenkins通知问题反馈">问题反馈</a>
|
|
</div>
|
|
<p style="margin-top: 15px; font-size: 12px; color: #999;">
|
|
© ${YEAR} ${COMPANY_NAME} - 自动化部署平台
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |