-
Notifications
You must be signed in to change notification settings - Fork 1
/
check-git-repos-everywhere
executable file
·41 lines (34 loc) · 1.26 KB
/
check-git-repos-everywhere
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
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -e -f -u -o pipefail
check_single_host() {
local host="$1"
printf "\n\n\nProcessing %s\\n" "${host}"
# shellcheck disable=SC2016
retry 10 "${host}" ssh -o ControlMaster=no -t "johntobin@${host}" \
'check-git-repos "${HOME}/bin" "${HOME}/src/"*'
}
if [[ -z "${CAFFEINATED:-}" ]]; then
CAFFEINATED="do not sleep"
export CAFFEINATED
exec caffeinate -i "$0"
fi
# Deal with the special cases first.
# hugo-coder needs to be updated in the right order.
# Don't wrap with with retry: it's easier to fix the problems without the
# tooling making changes in parallel, and restarting from scratch doesn't lose
# any progress because this is the first action.
update-hugo-coder
# I used to update ariane-theme here but stopped because the changes are
# infrequent, I will almost certainly manually push any changes I make. and the
# checks take a long time.
# dotfiles and bin are the next most likely source of diffs, and they can be
# fixed mostly automatically.
printf "\\n\\n\\ndotfiles\\n"
update-dotfiles-and-bin-everywhere
# Run a second time so that commits from later machines are pulled to earlier
# machines.
update-dotfiles-and-bin-everywhere
# Now do the rest of the checks.
for host in laptop home hosting; do
check_single_host "${host}"
done