Files
Nexus/scripts/run_btpanel_tests_docker.sh
T
2026-07-08 22:31:31 +08:00

29 lines
1013 B
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
IMAGE="${NEXUS_TEST_PYTHON_IMAGE:-python:3.12-slim}"
PIP_INDEX_URL_VALUE="${PIP_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple}"
DOCKER_PULL_PROXY="${NEXUS_DOCKER_PULL_PROXY:-socks5://127.0.0.1:10808}"
if [ "${DOCKER_PULL_PROXY}" != "off" ]; then
export HTTP_PROXY="${DOCKER_PULL_PROXY}"
export HTTPS_PROXY="${DOCKER_PULL_PROXY}"
export ALL_PROXY="${DOCKER_PULL_PROXY}"
export http_proxy="${DOCKER_PULL_PROXY}"
export https_proxy="${DOCKER_PULL_PROXY}"
export all_proxy="${DOCKER_PULL_PROXY}"
fi
if ! command -v docker >/dev/null 2>&1; then
echo "ERROR: docker is not available" >&2
exit 127
fi
docker run --rm \
-v "${ROOT_DIR}:/workspace" \
-w /workspace \
-e PIP_INDEX_URL="${PIP_INDEX_URL_VALUE}" \
"${IMAGE}" \
bash -lc 'python -V && python -m pip install -r requirements.txt -r requirements-dev.txt && python scripts/run_local_release_gate.py --with-pytest --skip-frontend'