티스토리 뷰

Many older builds per Jenkins Job have a significant impact on performance.
Below is a script that looks for the old build count for each Job.

get_build_count_for_each_job.sh
https://github.com/mcpaint/scripts/blob/master/jenkins/get_build_count_for_each_job.sh

# Input your Jenkins domain
domain=https://<your Jenkins domain>
# Input directory with Jenkins jobs
job_dir=/mcpaint/jenkins_home/jobs

IFS=$'\n' jobs=(`ls -1 $job_dir`)

for job in "${jobs[@]}"; do
  build_dir=$job_dir/$job/builds
  encoded_job=$(python -c "import urllib; print urllib.quote('''$job''')")
  if test -d $build_dir
    then echo -e "$(ls -A1 $build_dir | grep -v last | grep -v legacyIds | wc -l) $job\t$domain/job/$encoded_job"
  fi
done

How to sorting

$ sh get_build_count_for_each_job.sh | sort -nr
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함