2021-10-06 14:06:37 +02: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 07:38:30 +01:00
|
|
|
AWAY="${BUILDS}/away"
|
2021-10-06 14:06:37 +02:00
|
|
|
|
2022-01-26 07:38:30 +01:00
|
|
|
WEB="${TEMP}/web"
|
|
|
|
TEST="${TEMP}/test"
|
2021-10-06 14:06:37 +02:00
|
|
|
|
|
|
|
ARCH="$(uname -m)"
|
2022-01-26 07:38:30 +01:00
|
|
|
BIN="${TEMP}/${ARCH}"
|
2021-10-06 14:06:37 +02:00
|
|
|
|
|
|
|
ssh "${USER_HOST}" "mkdir -p ${WEB} ${TEST} ${BIN}"
|
|
|
|
|
|
|
|
cd test
|
|
|
|
|
|
|
|
./ci
|
|
|
|
scp ci.webm perf.js ci.js ../doc/*.png "${USER_HOST}:${WEB}/"
|
|
|
|
scp test_logs/* "${USER_HOST}:${TEST}/"
|
|
|
|
|
|
|
|
./run_demo
|
|
|
|
scp demo_passt.webm demo_pasta.webm "${USER_HOST}:${WEB}/"
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
make static
|
|
|
|
scp passt pasta qrap passt.1 pasta.1 qrap.1 "${USER_HOST}:${BIN}"
|
|
|
|
|
|
|
|
make pkgs
|
|
|
|
ssh "${USER_HOST}" "rm -f ${BIN}/*.deb"
|
|
|
|
ssh "${USER_HOST}" "rm -f ${BIN}/*.rpm"
|
|
|
|
scp *.deb *.rpm "${USER_HOST}:${BIN}/"
|
|
|
|
|
2022-01-26 07:38:30 +01:00
|
|
|
CFLAGS="-static -DGLIBC_NO_STATIC_NSS" make avx2
|
2021-10-06 14:06:37 +02:00
|
|
|
ssh "${USER_HOST}" "mkdir -p ${BIN}/avx2"
|
|
|
|
scp passt pasta qrap passt.1 pasta.1 qrap.1 "${USER_HOST}:${BIN}/avx2/"
|
|
|
|
|
|
|
|
make pkgs
|
|
|
|
ssh "${USER_HOST}" "rm -f ${BIN}/avx2/*.deb"
|
|
|
|
ssh "${USER_HOST}" "rm -f ${BIN}/avx2/*.rpm"
|
|
|
|
scp *.deb *.rpm "${USER_HOST}:${BIN}/avx2/"
|
|
|
|
|
2022-01-26 07:38:30 +01:00
|
|
|
ssh "${USER_HOST}" "mv ${LATEST} ${AWAY}"
|
|
|
|
ssh "${USER_HOST}" "mv ${TEMP} ${LATEST}"
|
|
|
|
ssh "${USER_HOST}" "rm -rf ${AWAY}"
|
|
|
|
|
2021-10-06 14:06:37 +02:00
|
|
|
# Legacy, for KubeVirt tests
|
2022-01-26 07:38:30 +01:00
|
|
|
# CFLAGS="-DPASST_LEGACY_NO_OPTIONS -static" make avx2
|
|
|
|
# scp passt qrap "${USER_HOST}:${BUILDS}/static/"
|