-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ansible: automatic clean-up of binary_tmp repo
PR-URL: #1515 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
- Loading branch information
1 parent
bd5a1fc
commit 5961359
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -ex | ||
|
||
cd ~binary_tmp/binary_tmp.git | ||
(echo; date) >> ~binary_tmp/clean_binary_tmp.log | ||
du -sh ~binary_tmp/binary_tmp.git/ >> ~binary_tmp/clean_binary_tmp.log | ||
|
||
git fetch origin +master:master | ||
|
||
for b in $(git branch | sed /\*/d); do | ||
if [ -z "$(git log -1 --since='7 days ago' -s $b)" ]; then | ||
(git branch -D $b |& tee -a ~binary_tmp/clean_binary_tmp.log) || true | ||
fi | ||
done | ||
|
||
git prune | ||
|
||
du -sh ~binary_tmp/binary_tmp.git/ >> ~binary_tmp/clean_binary_tmp.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters