Hash :
0b3d0216
Author :
Thomas de Grivel
Date :
2023-02-15T12:50:52
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 42 43 44 45 46 47 48 49 50 51 52 53 54
#!/bin/sh
set -e
# shpkg
: ${SHPKG_DIR:=~/shpkg}
. "${SHPKG_DIR}/etc/shpkg/profile"
. "${SHPKG_DIR}/share/shpkg/shpkg.subr"
verbose 2 shpkg_config
verbose 2 shpkg_lock shpkg_ci_mux.lock
# Configuration
: ${SHPKG_CI_DIR:=${SHPKG_DIR}/ci}
shpkg_ci_remote () {
verbose 1 ssh "$1" sh -c "\"shpkg/bin/shpkg_ci '$2'\""
if [ "x$2" != "x--upgrade" ]; then
verbose 1 rsync -a "$1":shpkg/ci/. "${SHPKG_CI_DIR}/"
fi
}
main () {
SHPKG_REPO="$1"
shift
for SHPKG_CI_MUX_HOST; do
shpkg_ci_remote "${SHPKG_CI_MUX_HOST}" "${SHPKG_REPO}" &
done
for SHPKG_CI_MUX_HOST; do
wait
done
if [ "x${SHPKG_REPO}" == "x--upgrade" ]; then
exit
fi
( cd "${SHPKG_CI_DIR}/status" &&
for S in $(ls */*/*.status | cut -d / -f 3 | sort -u); do
{
if grep -q running */*/"$S"; then
echo running
elif grep -q ko */*/"$S"; then
echo ko
else
echo ok
fi
} > "${SHPKG_CI_DIR}/status/$S"
done; )
}
shpkg_log shpkg_ci_mux main "$@"