Skip to content

Commit

Permalink
ansible: update branch used in clean_binary_tmp.sh (#2978)
Browse files Browse the repository at this point in the history
Update `clean_binary_tmp.sh` script to reference `main` instead of
`master`.

Fix up the `jenkins-workspace` role to run as the owner of the git
repository when disabling automatic gc.

Fixes: #2977
Refs: nodejs/node#33864
  • Loading branch information
richardlau authored Jun 28, 2022
1 parent 2d901f7 commit 65b68ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ansible/roles/jenkins-workspace/files/clean_binary_tmp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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
git fetch origin +main:main

for b in $(git branch | sed /\*/d); do
if [ -z "$(git log -1 --since='7 days ago' -s $b)" ]; then
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/jenkins-workspace/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
regexp: "clean_binary_tmp"

- name: Disable automatic garbage collection
become: true
become_user: binary_tmp
command: "git config gc.auto 0"
args:
chdir: "~binary_tmp/binary_tmp.git/"
Expand Down

0 comments on commit 65b68ec

Please sign in to comment.