With too many builds, there will be insufficient space in the Jenkins build. The solution is as follows:
Table of contents
1. When configuring, remove old build tasks
2. Use script to delete historical builds
1. When configuring, remove old build tasks
2. Use script to delete historical builds
- Open the Jenkins homepage
- Select menu Manage Jenkins
- Enter Script Console
3. Enter the Script Console
- Paste the script and run it
例如:删除构建任务NAME 40次以前的构建任务
def jobName = "NAME"
def maxNumber = 40
Jenkins.instance.getItemByFullName(jobName).builds.findAll {
it.number <= maxNumber
}.each {
it.delete()
}
3. Clear disk space
According to the directory where Jenkins prompts that there is insufficient space, use the du command to find the large file and delete it.
When it does not take effect, clean the disk
4. Reload the server node
For example, if the above steps of clearing the build history and clearing the space are not enough, try reloading the server node with jenkisn. There may be a cache.