passt/hooks/pre-push
David Gibson 4e9b50f7b6 test: Move video processing files to $STATEBASE
The asciinema video handling creates a number of temporary files (.uncat,
.start, .stop) which currently go into the source tree.  Put them in the
temporary state directory to avoid clutter.

The final processed output is now placed into test_logs/web/ along with the
corresponding .js file with links, since they're essentially test
artefacts.  hooks/pre-push is updated to look for those files in the new
location when updating the web site.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2022-09-13 11:12:41 +02:00

70 lines
1.7 KiB
Bash
Executable file

#!/bin/sh -e
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# PASST - Plug A Simple Socket Transport
# for qemu/UNIX domain socket mode
#
# PASTA - Pack A Subtle Tap Abstraction
# for network namespace/tap device mode
#
# hooks/pre-push - Run CI. On success, run demos, build, and copy all contents
#
# Copyright (c) 2021 Red Hat GmbH
# Author: Stefano Brivio <sbrivio@redhat.com>
#
# cp hooks/pre-push .git/hooks/pre-push
USER_HOST="passt.top"
BASE="/var/www/passt"
BUILDS="${BASE}/builds"
LATEST="${BUILDS}/latest"
TEMP="${BUILDS}/temp"
AWAY="${BUILDS}/away"
WEB="${TEMP}/web"
TEST="${TEMP}/test"
ARCH="$(uname -m)"
BIN="${TEMP}/${ARCH}"
ssh "${USER_HOST}" "mkdir -p ${WEB} ${TEST} ${BIN}"
cd test
./ci
gzip -fk9 perf.js
scp perf.js perf.js.gz "${USER_HOST}:${WEB}/"
scp test_logs/* "${USER_HOST}:${TEST}/"
./run_demo
for f in test_logs/web/*.cast test_logs/web/*.js; do
gzip -fk9 "${f}"
scp "${f}" "${USER_HOST}:${WEB}/"
scp "${f}.gz" "${USER_HOST}:${WEB}/"
done
cd ..
make pkgs
scp passt passt.avx2 passt.1 qrap qrap.1 "${USER_HOST}:${BIN}"
scp pasta pasta.avx2 pasta.1 "${USER_HOST}:${BIN}"
ssh "${USER_HOST}" "rm -f ${BIN}/*.deb"
ssh "${USER_HOST}" "rm -f ${BIN}/*.rpm"
scp *.deb *.rpm "${USER_HOST}:${BIN}/"
man2html -M "/" passt.1 > passt.1.html
scp passt.1.html "${USER_HOST}:${WEB}/"
for pic in passt_overview pasta_overview; do
cwebp -preset drawing -q 10 "doc/${pic}.png" -o "doc/${pic}.webp"
scp "doc/${pic}.png" "doc/${pic}.png" "${USER_HOST}:${WEB}/"
scp "doc/${pic}.webp" "doc/${pic}.webp" "${USER_HOST}:${WEB}/"
done
scp doc/*.html "${USER_HOST}:${WEB}/"
ssh "${USER_HOST}" "mv ${LATEST} ${AWAY}"
ssh "${USER_HOST}" "mv ${TEMP} ${LATEST}"
ssh "${USER_HOST}" "rm -rf ${AWAY}"