Jenkins server disk space management policy

Source: Internet
Author: User
Tags server installation and configuration

Jenkins server disk space management policy

Jenkins helps us automate the construction of services while also consuming server disk space. Imagine if there are a large number of projects and the disk space of the Jenkins server is not very large, at intervals, the disk space will be full, resulting in the failure of building Jenkins due to insufficient disk space. At this time, we need some manual intervention to restore the normal operation of Jenkins. Based on the Windows operating system and Jenkins related features, this article solves the above problems.

1. manually delete building records

This is the most basic method to manage disk space by directly physically deleting building records. You can manually delete the building record as follows:

  1. Go to the Jenkins root directory, which is located in the. jenkins folder in the current user directory by default in Windows.
  2. Manually delete the building record. The building record is located in. jenkins \ jobs \ XXX \ builds (where XXX is the specific project name) and organized by timestamp. Delete the corresponding building history as needed.
Ii. Transfer Disk Space

The idea of transferring disk space is to change the default home directory of Jenkins to transfer the building record to another disk. Taking Windows as an example, a lot of software is installed on the disk where the user directory is located, resulting in insufficient disk space. Other disk spaces can be dynamically divided and managed. If you can store Jenkins building records in a relatively large space that can be dynamically managed, it will undoubtedly solve the problem of insufficient disk space. The specific operation method is also very simple:

  1. Create the Jenkins root directory environment variable JENKINS_HOME and map the environment variable to a specific working directory.
  2. Restart Jenkins.

Of course, transferring disk space is only a relatively optimized strategy. If there is a huge demand for building, this policy is usually a temporary solution, so we still have a third policy.

Iii. Automatically discard historical building data

One build contains two products: Build record and Build artifacts. Building record is a basis for tracking, analysis, and feedback, and has saved value. Outdated building artifacts can usually be discarded directly. Based on the above ideas, Jenkins provides us with the "discard old build" configuration function. You can save the building record and discard the building artifacts through reasonable configuration. The configuration method is as follows:

In the above example, by limiting the maximum number of # builds retained in the release package, we can automatically ensure that only the most recent Build artifacts are saved in the corresponding build results of the project, to optimize the efficiency of disk space usage.

Iv. Summary

With the above three policies, we can choose one or more of them in our actual work to ensure the stability of the Jenkins service.

----------------------------------- Split line -----------------------------------

Automated Testing for building sustainable integration of robotium + jenkins + TMTS in Linux

Modify the jenkins port number in Ubuntu

Build jenkins in Linux

Jenkins Server installation and configuration

Configure role-based project permission management for jenkins

Install jenkins in Ubuntu Desktop 12.04 LTS

Build an Android automatic packaging environment with Jenkins

----------------------------------- Split line -----------------------------------

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.