#!/usr/bin/env bash set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" DEST_DIR="${1:-${ROOT_DIR}/artifacts/qa/latest}" mkdir -p "$DEST_DIR" copy_path() { local source_path="$1" local target_name="${2:-$(basename "$source_path")}" if [[ -e "$source_path" ]]; then rm -rf "$DEST_DIR/$target_name" cp -R "$source_path" "$DEST_DIR/$target_name" fi } copy_tail() { local source_path="$1" local target_name="$2" if [[ -f "$source_path" ]]; then tail -n 200 "$source_path" > "$DEST_DIR/$target_name" fi } copy_path "$ROOT_DIR/client/playwright-report" "playwright-report" copy_path "$ROOT_DIR/client/test-results" "test-results" copy_path "/tmp/hyb-oa-regression/report.json" "regression-report.json" copy_path "/tmp/hyb-oa-web-gates-server.log" "hyb-oa-web-gates-server.log" copy_path "/tmp/hyb-oa-server.log" "hyb-oa-server.log" copy_tail "/tmp/hyb-oa-web-gates-server.log" "hyb-oa-web-gates-server.tail.log" copy_tail "/tmp/hyb-oa-server.log" "hyb-oa-server.tail.log" git -C "$ROOT_DIR" status --short > "$DEST_DIR/git-status.txt" || true echo "$DEST_DIR"