Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

How to delete old Jenkins builds on repository branches

Certain job properties are adjusted using directives in Jenkinsfiles and not the configuration in the web UI. In your Jenkinsfile:

properties([
  // only keep 25 builds to prevent disk usage from growing out of control
  buildDiscarder(
    logRotator(
      artifactDaysToKeepStr: '', 
      artifactNumToKeepStr: '', 
      daysToKeepStr: '', 
      numToKeepStr: '25',
    ),
  ),
])

You may of course adjust the various parameters to suit your needs.

Tags:

Jenkins

Related

Is there a reason to use an SSL certificate other than Let's Encrypt's free SSL? Windows 10 Always On VPN, Split DNS, NRPT, and how to configure which DNS server is used? UFW comment existing rule? How to access shared folder on Windows 10 from Windows XP? What is the difference between maintenance and standby in pacemaker Is there a way to protect SSD from corruption due to power loss? In Azure AD, is it possible to change the owner of a Windows 10 device? How can I add in Apache Feature Policy Header? Apache 2.4 is unkillable and can't be stopped on Windows Server Why openssl ignore -days for expiration date for self signed certificate? How do I set a password on an Ubuntu cloud image? Apparently Robocopy does not understand Windows Server 2016 deduplication. Is there a way to make it work without corrupting the volume?

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy