artifactview/tests/testfiles/sites/make_zip.sh

37 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# Create artifacts for testing
set -e
cd "$(dirname "$0")"
TARGET="../sites_data"
# http://codeberg-org--thetadev--artifactview-test--1-1.localhost:3000
T_VIEW="codeberg-org--thetadev--artifactview-test--1-1"
# http://codeberg-org--thetadev--artifactview-test--1-2.localhost:3000
T_404="codeberg-org--thetadev--artifactview-test--1-2"
# http://codeberg-org--thetadev--artifactview-test--1-3.localhost:3000
T_SPA="codeberg-org--thetadev--artifactview-test--1-3"
mkdir -p $TARGET
rm -f $TARGET/*
zip --no-dir-entries $TARGET/$T_SPA index.html style.css 200.html
zip --no-dir-entries $TARGET/$T_404 index.html style.css 404.html
zip --no-dir-entries -r $TARGET/$T_VIEW robots.txt .well-known
zip --no-dir-entries --junk-paths $TARGET/$T_VIEW example.rs ../../../README.md
(
cd ..
zip --no-dir-entries -r sites_data/$T_VIEW junit sites/index.html sites/style.css
)
printf "404" > $TARGET/$T_404.name
printf "spa" > $TARGET/$T_SPA.name
printf "view" > $TARGET/$T_VIEW.name
if [ -n "$LTST" ]; then
mkdir -p /tmp/artifactview
cp $TARGET/* /tmp/artifactview
echo "copied artifacts for local testing"
fi