A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label jenkins. Show all posts
Showing posts with label jenkins. Show all posts

Jenkins email notifications

The default Jenkins email notifications are almost unusable, they contain a complete output of the build log. How to set up custom notifications:
Subject: [CI] Nightly "master" test results - Build #${BUILD_NUMBER} - ${BUILD_STATUS}

Body:

Nightly master tests


Test run #${BUILD_NUMBER} for "${PROJECT_DISPLAY_NAME}"


Summary

Result: ${BUILD_STATUS} - ${TEST_COUNTS, var="fail"} failures
${TEST_COUNTS, var="pass"} out of ${TEST_COUNTS, var="total"} tests passed (${TEST_COUNTS, var="skip"} skipped).


Details

${FAILED_TESTS, showStack=false, showMessage=false}

Jenkins admin notes

Some things to help on your Continuous Integration journey with Jenkins:

  • Use  docker pull jenkins  for a quick start
  • Security can be a bit fiddly to set up. Try these easy settings:
    • Jenkins’ own user database
    • Allow users to sign up
    • Logged-in users can do anything
  • There is a Role-Based Strategy plugin for more advanced use
  • If you accidentally lock yourself out, edit  $JENKINS_HOME/config.xml  to say false and restart Jenkins
  • To see a list of failing tests, configure a Post-build action for  "Publish JUnit test result report"

-- Jenkins ver. 1.642.2

Writing a Jenkins plugin for dummies


This guide is written for Ubuntu

Install Jenkins
  • Follow these steps
  • It will install this file amongst others: /usr/share/jenkins/jenkins.war
  • You may need to start Jenkins on a different port than its default 8080
  • The config is in this file: /etc/default/jenkins
    • There are a list of command-line options at the end of this file
  • You run it with this command:
    • java -jar /usr/share/jenkins/jenkins.war --httpPort=9090
    • (however this doesn't use the config you just edited)
Write a plugin