1
0
mirror of https://passt.top/passt synced 2024-12-22 13:45:32 +00:00
passt/hooks/pre-push
Stefano Brivio fb820ebb2e hooks: Temporarily disable demo generation in pre-push
The out-of-tree Podman patch needs to be rebased every second week or
so, and I'm currently trying to get that upstream:
  https://github.com/containers/podman/pull/16141

Disable demo generation for the moment, so that I avoid wasting time
with those rebases. We'll re-enable it later.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-10-26 06:56:25 +02:00

81 lines
2.0 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"
WEB="${TEMP}/web"
TEST="${TEMP}/test"
ARCH="$(uname -m)"
BIN="${TEMP}/${ARCH}"
OLD_BIN="${LATEST}/${ARCH}"
ssh "${USER_HOST}" "mkdir -p ${WEB} ${TEST} ${BIN}"
cd test
./ci
scp test_logs/*.log "${USER_HOST}:${TEST}/"
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
# TODO: Re-enable demos once we have pasta support in upstream Podman
skip() {
./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}" "cp ${WEB}/* ${LATEST}/web/"
ssh "${USER_HOST}" "cp ${TEST}/* ${LATEST}/test/"
ssh "${USER_HOST}" "rm -f ${OLD_BIN}/*"
ssh "${USER_HOST}" "cp ${BIN}/* ${LATEST}/${ARCH}/"
ssh "${USER_HOST}" "rm -rf ${TEMP}"