2021-10-06 12:06:37 +00:00
|
|
|
#!/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"
|
2022-01-26 06:38:30 +00:00
|
|
|
AWAY="${BUILDS}/away"
|
2021-10-06 12:06:37 +00:00
|
|
|
|
2022-01-26 06:38:30 +00:00
|
|
|
WEB="${TEMP}/web"
|
|
|
|
TEST="${TEMP}/test"
|
2021-10-06 12:06:37 +00:00
|
|
|
|
|
|
|
ARCH="$(uname -m)"
|
2022-01-26 06:38:30 +00:00
|
|
|
BIN="${TEMP}/${ARCH}"
|
2021-10-06 12:06:37 +00:00
|
|
|
|
|
|
|
ssh "${USER_HOST}" "mkdir -p ${WEB} ${TEST} ${BIN}"
|
|
|
|
|
|
|
|
cd test
|
|
|
|
|
|
|
|
./ci
|
2022-03-02 12:17:14 +00:00
|
|
|
gzip -fk9 perf.js ci.js
|
|
|
|
scp perf.js perf.js.gz ci.js ci.js.gz "${USER_HOST}:${WEB}/"
|
2021-10-06 12:06:37 +00:00
|
|
|
scp test_logs/* "${USER_HOST}:${TEST}/"
|
|
|
|
./run_demo
|
2022-02-23 12:28:26 +00:00
|
|
|
|
|
|
|
for cast in ci demo_pasta demo_podman demo_passt; do
|
2022-02-28 01:51:34 +00:00
|
|
|
gzip -fk9 "${cast}.cast"
|
|
|
|
scp "${cast}.cast" "${USER_HOST}:${WEB}/"
|
|
|
|
scp "${cast}.cast.gz" "${USER_HOST}:${WEB}/"
|
2022-02-23 12:28:26 +00:00
|
|
|
done
|
2021-10-06 12:06:37 +00:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
make pkgs
|
2022-03-01 20:41:22 +00:00
|
|
|
scp passt passt.avx2 passt.1 qrap qrap.1 "${USER_HOST}:${BIN}"
|
|
|
|
scp pasta pasta.avx2 pasta.1 "${USER_HOST}:${BIN}"
|
|
|
|
|
2021-10-06 12:06:37 +00:00
|
|
|
ssh "${USER_HOST}" "rm -f ${BIN}/*.deb"
|
|
|
|
ssh "${USER_HOST}" "rm -f ${BIN}/*.rpm"
|
|
|
|
scp *.deb *.rpm "${USER_HOST}:${BIN}/"
|
|
|
|
|
2022-03-01 20:41:22 +00:00
|
|
|
man2html -M "/" passt.1 > passt.1.html
|
|
|
|
scp passt.1.html "${USER_HOST}:${WEB}/"
|
|
|
|
|
2022-03-02 12:17:14 +00:00
|
|
|
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}/"
|
2022-03-30 12:34:16 +00:00
|
|
|
scp "doc/${pic}.webp" "doc/${pic}.webp" "${USER_HOST}:${WEB}/"
|
2022-03-02 12:17:14 +00:00
|
|
|
done
|
2022-03-04 15:34:52 +00:00
|
|
|
scp doc/*.html "${USER_HOST}:${WEB}/"
|
2022-03-02 12:17:14 +00:00
|
|
|
|
2022-01-26 06:38:30 +00:00
|
|
|
ssh "${USER_HOST}" "mv ${LATEST} ${AWAY}"
|
|
|
|
ssh "${USER_HOST}" "mv ${TEMP} ${LATEST}"
|
|
|
|
ssh "${USER_HOST}" "rm -rf ${AWAY}"
|