feat(jenkinsfile): Add proper HTML page with version display
This commit is contained in:
61
apps/demo-nginx/Jenkinsfile
vendored
61
apps/demo-nginx/Jenkinsfile
vendored
@@ -52,15 +52,70 @@ pipeline {
|
||||
steps {
|
||||
echo "Checking out application source code..."
|
||||
|
||||
sh '''
|
||||
// Create Dockerfile with actual version
|
||||
sh """
|
||||
cat > Dockerfile << 'EOF'
|
||||
FROM nginx:1.25.3-alpine
|
||||
RUN echo "<html><body><h1>Demo Nginx - Build ${BUILD_NUMBER}</h1><p>Environment: Production</p><p>Version: ${IMAGE_TAG}</p></body></html>" > /usr/share/nginx/html/index.html
|
||||
COPY index.html /usr/share/nginx/html/index.html
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
EOF
|
||||
'''
|
||||
"""
|
||||
|
||||
// Create index.html with actual version
|
||||
sh """
|
||||
cat > index.html << EOF
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Demo Nginx</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
max-width: 800px;
|
||||
margin: 50px auto;
|
||||
padding: 20px;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
}
|
||||
.container {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
padding: 40px;
|
||||
border-radius: 10px;
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
h1 {
|
||||
font-size: 48px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
p {
|
||||
font-size: 24px;
|
||||
margin: 10px 0;
|
||||
}
|
||||
.version {
|
||||
font-family: 'Courier New', monospace;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
padding: 10px 20px;
|
||||
border-radius: 5px;
|
||||
display: inline-block;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>🚀 Demo Nginx - Build #${BUILD_NUMBER}</h1>
|
||||
<p>Environment: Production</p>
|
||||
<p class="version">Version: ${IMAGE_TAG}</p>
|
||||
<p style="font-size: 16px; margin-top: 30px; opacity: 0.8;">
|
||||
Image: ${DOCKER_REGISTRY}/${DOCKER_REPO}/${APP_NAME}:${IMAGE_TAG}
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
"""
|
||||
|
||||
sh '''
|
||||
cat > nginx.conf << 'EOF'
|
||||
|
||||
Reference in New Issue
Block a user