CICD Jenkins - Send email with default content


CICD Jenkins - Send email with default content

CICD Jenkins - Send email with default content

Send email with default content as the build output

Prerequisite Plugins

-Email-ext plugin

Steps

  • Create new job with freestyle
  • [Optional]In Source Code Management section configure the git if required
  • Configure the build section with type of build
  • Post-build Actions select Editable email notification configue the following properties

    Project Recipient List: email@email.com,example@example.example

    Project Reply-To List: no-reply@domain.com

    Content Type: Select as required

    Default Subject: Subject

    Default Content:

        Option1: Content Type - Text -> `${BUILD_LOG_EXCERPT, start="^Start", end="^End"}`
    
        Option2: Content Type - html -> `<pre>${BUILD_LOG_EXCERPT, start="^Start", end="^End"}</pre>`
    
  • Save and test

Example:

How to send build output as email to the specific email?

  • Execute shell
echo "Start"

git log --since="1 week ago" --pretty=format:'%cd %<(20)%an %s' --date=format:'%Y-%m-%d %H:%M:%S'

echo "End"
  • Post-build Actions select Editable email notification configue the following properties

    Project Recipient List: jinna.balu@platform-ops.com

    Project Reply-To List: admin@platform-ops.com

    Content Type: Select as required

    Default Subject: Developers Weekly Progress

    Default Content: ```bash Hi All,
    Here is the feature and bug progress of the week

${BUILD_LOG_EXCERPT, start="^Start", end="^End"}

Regards
Platform Ops Admin ```

  • Save

Related Post:

Why Python for Production Services

Vector Deployment Patterns

Vector Aggregator — Transform and Route

Vector Agent — Lightweight Log Collection

HashiCorp Vault — Centralized Secret Management

Vault Auth Methods — Token vs AppRole

Unit Tests for Business Logic

Test Coverage and CI Integration

Docker Swarm Deployment

Why Structured Logging Matters

structlog — JSON Logging with Context

Secret Workflow — Local to Production

Scheduled Security Scans

Production Operations Runbook

pytest — Fixtures, Conftest, and Async Testing

Pydantic — Request & Response Validation

Prometheus Metrics — RED Method

Project Structure with pyproject.toml

Pre-Commit Hooks for Security

Auto-Instrumentation for FastAPI

OpenTelemetry — Traces, Spans, and Context

Marathon/Mesos Deployment

Log Rotation and Disk Management

End-to-End Pipeline

Kubernetes Deployment

Kafka — Durable Log Transport

Jaeger — Visualizing Distributed Traces

Integration Tests for API Endpoints

Health Checks and Readiness Probes

Graceful Shutdown

GitHub Actions CI Pipeline

FastAPI — Async-First HTTP Framework

Error Handling & Response Models

Elasticsearch + Kibana — Search and Visualize

Dual Output — Stdout and File Logging

Docker — Containerize from Day One

Docker Compose Deployment

Dependency Updates and Maintenance

Dependency Auditing with pip-audit

Request-Scoped Logging with Correlation IDs

Container Security with Trivy

Environment-Based Config with pydantic-settings

Async Database Operations

API Versioning Strategies

RESTful Route Design with FastAPI Router

K8s Contributor Playground, Learning by Contributing

Git - Switch Remote URL

Git - Reset Commits

Git - Cheat Sheet

Git - Push with SSH

Git - Merge

Git - Init

Git - Project Lead/Manager

Git - Commit Files

Git - Create Branch

Git - Common Commands

Git - Branch Management

Adding Try in PWD button to README file

Docker Issues

Git - Basics for a Developer

SED

AWS EBS Volmes - Create and attach the EBS volume with mounting

Elasticsearch - Dumping documents from multi-node to single node

Git - Intro

Linux - sed command

Arachni - VAPT Tool

VAPT - Vulnerability Assessment and Penetration Testing