Skip to content

DevOps Tutorials

DevOps, DevOps & Only DevOps by scmGalaxy

  • Courses
  • Training Calender
  • Community
  • DevOps Jobs
  • Contact us
  • DevOps Trainer
  • DevOps Support
  • Upload CV

Tag: Attach

How to attach the jenkins build log as part of the email body?

by rajeshkumarOctober 3, 2015December 17, 2017JenkinsLeave a Comment on How to attach the jenkins build log as part of the email body?
How to attach the jenkins build log as part of the email body?
jenkins-build-log-as-part-of-the-email-body
Way 1 – 
Put following lines as part of Default Content text box
${BUILD_LOG, maxLines=9999, escapeHtml=false}
this works for free style projects
Way 2 – If you want send only specific line using regex
${BUILD_LOG_REGEX, regex=”\\b(Buildfile|BUILD)\\b”, linesAfter=1}
${BUILD_LOG_REGEX, regex=”^.*?BUILD FAILED.*?$”, linesBefore=0, linesAfter=10, maxMatches=5, showTruncatedLines=false, escapeHtml=true}
${BUILD_LOG_REGEX, regex=”\\b(FC0)\\b”, linesAfter=1}
${BUILD_LOG_REGEX, regex=”^.*?BUILD FAILED.*?$”, linesBefore=0, linesAfter=10, maxMatches=5, showTruncatedLines=false, escapeHtml=true}
${BUILD_LOG_REGEX, regex=”^.*?FC0.*?$”, maxMatches=95, showTruncatedLines=false, escapeHtml=false, matchedLineHtmlStyle=true}
This will show exactly which is expected lines as part of the regEx.
List of other variables as part of email body
${PROJECT_URL}/ws/
${BUILD_URL}/artifact/
${BUILD_LOG, maxLines=1000}
More ref
Content Token Reference
In string arguments, escape “, \, and line terminators (\n or \r\n) with a \, e.g. arg1=”\”quoted\””; arg2=”c:\\path”; and arg3=”one\ntwo”. The brackets may be omitted if there are no arguments.
New Lines – Use <br> or “\”
More Info 
http://wiki.hudson-ci.org/display/HUDSON/Email-ext+plugin
http://stackoverflow.com/questions/9439450/how-will-i-filter-out-only-errors-in-jenkins-email-ext-build-log-regex
http://champasoft.blogspot.nl/2012/11/jenkins-pattern-for-e-mailing-log.html
https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin
Tagged : Attach / Build / Email body / Guide / How / How to attach jenkins build log / Jenkins / Jenkins build log / Jenkins build log in email body / Log / Part / Process / Steps / Tutorials / Ways

How to attach the jenkins build log as part of the email body?

by rajeshkumarSeptember 11, 2015December 17, 2017JenkinsLeave a Comment on How to attach the jenkins build log as part of the email body?
How to attach the jenkins build log as part of the email body?

jenkins-build-log-as-part-of-the-email-body

Way 1 – 

Put following lines as part of Default Content text box

${BUILD_LOG, maxLines=9999, escapeHtml=false}

this works for free style projects

Way 2 – If you want send only specific line using regex

${BUILD_LOG_REGEX, regex=”\\b(Buildfile|BUILD)\\b”, linesAfter=1}

${BUILD_LOG_REGEX, regex=”^.*?BUILD FAILED.*?$”, linesBefore=0, linesAfter=10, maxMatches=5, showTruncatedLines=false, escapeHtml=true}

${BUILD_LOG_REGEX, regex=”\\b(FC0)\\b”, linesAfter=1}

${BUILD_LOG_REGEX, regex=”^.*?BUILD FAILED.*?$”, linesBefore=0, linesAfter=10, maxMatches=5, showTruncatedLines=false, escapeHtml=true}

${BUILD_LOG_REGEX, regex=”^.*?FC0.*?$”, maxMatches=95, showTruncatedLines=false, escapeHtml=false, matchedLineHtmlStyle=true}

This will show exactly which is expected lines as part of the regEx.

More Info

http://wiki.hudson-ci.org/display/HUDSON/Email-ext+plugin

http://stackoverflow.com/questions/9439450/how-will-i-filter-out-only-errors-in-jenkins-email-ext-build-log-regex

http://champasoft.blogspot.nl/2012/11/jenkins-pattern-for-e-mailing-log.html

Tagged : Attach / Build / email / Email body / Guide / How / How to attach jenkins build log / Jenkins / Jenkins build log / Jenkins build log in email body / Log / Part / Process / Steps / Tutorials / Ways

Recent Posts

  • Use of runtime variables to save into another variable using register in Ansible
  • Ansible & Ansible Tower Variable Precedence Hierarchy
  • How to use template in Ansible?
  • Run Ansible Adhoc commands or playbook in Local mode
  • Ansible Playbook Lab & Excercise – Part 2

Categories

  • Amazon (Elastic Cloud)
  • Amazon Web Services
  • ANDROID
  • Ansible
  • AnthillPro
  • Apache Ant
  • Apache Ant
  • Apache Continuum
  • Apache Maven
  • App / Web Servers
  • Application Server
  • Artifactory
  • Bamboo
  • Bamboo
  • Batch Scripting
  • Build Management
  • Build Management & Tools
  • Build Tools
  • BuildForge
  • BuildForge
  • Chef
  • ClearCase
  • ClearCase
  • CLOUD COMPUTING AND OPERATING SOFTWARE
  • Code Analysis
  • Concept & Definition
  • Configuration Management Tools
  • Configuration Management Tools
  • CONTAINERS
  • Continuous Delivery
  • Continuous Inspection
  • Continuous Integration
  • Cruise Control
  • CVS
  • DevOps Community
  • DevOps Practice and Process
  • DevOps Tooling
  • Docker
  • General
  • Gerrit
  • Git
  • git
  • Grafana
  • Hacking & Security
  • HTML
  • IDEs and Editor
  • Incident and Bug Tracking Systems
  • Interview Questions & Answers
  • IT Infrastructure Monitoring Tools
  • Jenkins
  • Jenkins
  • Kubernetes
  • Linux
  • logstash
  • magento
  • makefile
  • Maven
  • Microsoft Windows
  • Msbuild
  • Nant
  • Network
  • Networking
  • News & Events
  • ngrok
  • OpenStake
  • Operating Systems
  • Other build Tools
  • others scripting language
  • Others Version Control Systems
  • Package Management
  • Perforce
  • Perforce
  • Perl
  • Perl Script
  • Practice of Software Configuration Management
  • Programming Scripting Languages
  • Prometheus
  • Puppet
  • Python
  • Quality Management
  • Release Concept
  • Release, News & Updates
  • Repository Manager Tools
  • Repository Manager Tools
  • Ruby
  • ruby programming
  • Scripting
  • Security Tools
  • sh404SEF custom content
  • Shell Script
  • Shell Scripting
  • Shortcuts
  • Software Containers
  • SonarQube
  • SonaType Nexus
  • source code analysis tools
  • Source Code Management
  • ssue-Bug Tracking System
  • SVN(Subversion)
  • SVN(Subversion)
  • Team Foundation Server
  • TeamCity
  • Teamcity
  • Test Coverage Tools
  • test coverage tools
  • Testing Tools
  • testing tools
  • TFS
  • Tools Comparison
  • Trainers
  • Training
  • Tutorials
  • uBuild
  • uDeploy
  • Uncategorised
  • Uncategorized
  • Unix – Linux
  • Unix / Linux
  • URelease
  • Version Control Systems
  • Version Management
  • Virtualization
  • Virtualization & Cloud
  • VSS
  • Websites
  • Windows
  • Zabbix

Archives

© Copyright 2021 DevOps Tutorials. All rights reserved | MadeBy99colorthemes