How to keep only last 5 build of certain job using Jenkins CLI -


i make jenkins' jobs cleanup more automate, of jobs (like test results) keep last 5 jobs. use jenkins cli deleting, don't know how build numbers of need delete. know?

you can try go jenkins master server

$jenkins_home/jobs/yourjobname/builds

and then, run following script

ls -ltr | awk '{print $9}' | grep -e [0-9]+ 

this script list folder info this

401 400 399 398 397 396 395 394 393 

you can try loop them , delete 1 want deleted.

br,

tim


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -