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 1+ #! /bin/bash -ex
2+
3+ cd ~ binary_tmp/binary_tmp.git
4+ (echo; date) >> ~ binary_tmp/clean_binary_tmp.log
5+ du -sh ~ binary_tmp/binary_tmp.git/ >> ~ binary_tmp/clean_binary_tmp.log
6+
7+ git fetch origin +master:master
8+
9+ for b in $( git branch | sed /\* /d) ; do
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
12+ fi
13+ done
14+
15+ git prune
16+
17+ du -sh ~ binary_tmp/binary_tmp.git/ >> ~ binary_tmp/clean_binary_tmp.log
Original file line number Diff line number Diff line change 8787 line : " MaxStartups 100:30:150"
8888 dest : " {{ ssh_config }}"
8989 regexp : " MaxStartups"
90+
91+ - name : Create clean-up script
92+ copy :
93+ src : " {{ role_path }}/files/clean_binary_tmp.sh"
94+ dest : " ~binary_tmp/clean_binary_tmp.sh"
95+ owner : " binary_tmp"
96+ group : " binary_tmp"
97+ mode : 0755
98+
99+ - name : Schedule clean-up script to run daily
100+ lineinfile :
101+ line : " 0 5 * * * binary_tmp ~binary_tmp/clean_binary_tmp.sh"
102+ dest : " /etc/crontab"
103+ 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