-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpost-log-hook
More file actions
executable file
·25 lines (22 loc) · 811 Bytes
/
Copy pathpost-log-hook
File metadata and controls
executable file
·25 lines (22 loc) · 811 Bytes
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
#!/bin/sh
exec >>~/logs-upload.log 2>&1
set -e
set -x
# take a lock
if [ "${FLOCKER}" != "$0" ]; then
exec env FLOCKER="$0" flock -e "$0" "$0" "$@"
fi
cd ~/QubesIncomingBuildLog
git fetch origin
sign_status=$(git log -1 --format=%G? origin/main)
[ "$sign_status" == "G" ]
git merge --ff-only origin/main
git add "$1"
git commit -m "Add $(realpath --relative-base=$PWD $1)"
git push origin main
# Call qrexec service to possibly notify other some other VM that log was
# received from particular VM; can be used to send some notify, post-process
# the log, or allow signing just built packages
# use 'dom0' as a placeholder - qrexec policy will redirect it to the right VM
# in Qubes 4.0, empty VM name will be allowed for this purpose
qrexec-client-vm dom0 qubesbuilder.LogReceived+$QREXEC_REMOTE_DOMAIN