Jenkins is an open source automation server that is widely used by many organizations to implement popular DevOps practices, such as Continuous Integration and Continuous Delivery. Jenkins is feature-rich and is vastly extendable through plugins. Further, Jenkins and its plugins improve rapidly. There is a new minor version of Jenkins released weekly, mostly with improvements, occasionally with bugs. The community manages core stability via the use of a long-term support release of Jenkins, which is mature and less feature-rich when compared to the latest version. For a stable system in a complex environment, you need to monitor, clean up storage, back up, keep control of your Jenkins scripts, and consistently clean and polish. This chapter has recipes for the most common tasks. Proper maintenance lowers the risk of failures, such as:
- New plugins causing exceptions: There are a lot of good plugins being written with rapid version changes. In this situation, it is easy for you to accidentally add new versions of plugins with new defects. There have been a number of occasions during upgrades when suddenly the plugin does not work. To combat the risk of plugin exceptions, consider using a test Jenkins instance before releasing to a critical system.
- Storage overflowing with artifacts: If you keep a build history that includes artifacts such as WAR files, large sets of JAR files, or other types of binaries and source code, then your storage space will be consumed at a surprising rate. Storage costs have decreased tremendously, but storage usage equates to longer backup times and more communication from slave to master. To minimize the risk of disk overflowing, you will need to consider your backup and restore policy and the associated build retention policy expressed in the advanced options of jobs.
- Script spaghetti: As jobs are written by various development teams, the location and style of the included scripts vary. This makes it difficult for you to keep track. Consider using well-defined locations for your scripts and a scripts repository managed through a plugin.
- Resource depletion: As memory is consumed, or the number of intense jobs increases, then Jenkins slows down. Proper monitoring and quick reactions
reduce impact. - A general lack of consistency between jobs due to organic growth: Jenkins is easy to install and use. The ability to seamlessly turn on plugins is addictive. The pace of adoption of Jenkins within an organization can be breathtaking. Without a consistent policy, your teams will introduce lots of plugins and also lots of ways of performing the same work. Conventions improve consistency and readability of jobs and thus decrease maintenance.
The Jenkins community is working hard on your behalf. If you see an issue, please report it back.
To add community bug reports or modify wiki pages, you will need to create an account at: https://wiki.jenkins-ci.org/display/JENKINS/Issue+Tracking.