File tree Expand file tree Collapse file tree
ansible/roles/jenkins-workspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33cd ~ binary_tmp/binary_tmp.git
44(echo; date) >> ~ binary_tmp/clean_binary_tmp.log
5+ du -sh ~ binary_tmp/binary_tmp.git/ >> ~ binary_tmp/clean_binary_tmp.log
56
67git fetch origin +master:master
78
89for b in $( git branch | sed /\* /d) ; do
9- if [ -z " $( git log -1 --since=' 4 weeks ago' -s $b ) " ]; then
10- (git branch -D $b || true) | & tee -a ~ binary_tmp/clean_binary_tmp.log
10+ if [ -z " $( git log -1 --since=' 7 days ago' -s $b ) " ]; then
11+ (git branch -D $b | & tee -a ~ binary_tmp/clean_binary_tmp.log) || true
1112 fi
1213done
1314
Original file line number Diff line number Diff line change 9696 group : " binary_tmp"
9797 mode : 0755
9898
99- - name : Schedule clean-up script to run weekly
99+ - name : Schedule clean-up script to run daily
100100 lineinfile :
101- line : " 0 5 * * 0 binary_tmp ~binary_tmp/clean_binary_tmp.sh"
101+ line : " 0 5 * * * binary_tmp ~binary_tmp/clean_binary_tmp.sh"
102102 dest : " /etc/crontab"
103103 regexp : " clean_binary_tmp"
104+
105+ - name : Disable automatic garbage collection
106+ command : " git config gc.auto 0"
107+ args :
108+ chdir : " ~binary_tmp/binary_tmp.git/"
You can’t perform that action at this time.
0 commit comments