2
0
mirror of synced 2025-02-13 08:56:30 +00:00
cs-codex-dist-tests/docker/docker-entrypoint.sh

34 lines
1.1 KiB
Bash
Raw Normal View History

2023-05-28 22:48:33 +03:00
#!/bin/bash
2024-11-28 19:57:28 +02:00
# Variables
## Common
2023-05-28 22:48:33 +03:00
SOURCE="${SOURCE:-https://github.com/codex-storage/cs-codex-dist-tests.git}"
BRANCH="${BRANCH:-master}"
FOLDER="${FOLDER:-/opt/cs-codex-dist-tests}"
2023-05-28 22:48:33 +03:00
2024-11-28 19:57:28 +02:00
## Tests specific
DEPLOYMENT_CODEXNETDEPLOYER_PATH="${DEPLOYMENT_CODEXNETDEPLOYER_PATH:-Tools/CodexNetDeployer}"
DEPLOYMENT_CODEXNETDEPLOYER_RUNNER="${DEPLOYMENT_CODEXNETDEPLOYER_RUNNER:-deploy-continuous-testnet.sh}"
CONTINUOUS_TESTS_FOLDER="${CONTINUOUS_TESTS_FOLDER:-Tests/CodexContinuousTests}"
CONTINUOUS_TESTS_RUNNER="${CONTINUOUS_TESTS_RUNNER:-run.sh}"
2023-05-28 22:48:33 +03:00
# Get code
2024-11-28 19:57:28 +02:00
echo -e "Cloning ${SOURCE} to ${FOLDER}\n"
2023-05-28 22:48:33 +03:00
git clone -b "${BRANCH}" "${SOURCE}" "${FOLDER}"
2024-11-28 19:57:28 +02:00
echo -e "\nChanging folder to ${FOLDER}\n"
2023-05-28 22:48:33 +03:00
cd "${FOLDER}"
2024-11-28 19:57:28 +02:00
# Run tests
echo -e "Running tests from branch '$(git branch --show-current) ($(git rev-parse --short HEAD))'\n"
2023-05-28 22:48:33 +03:00
if [[ "${TESTS_TYPE}" == "continuous-tests" ]]; then
2024-11-28 19:57:28 +02:00
echo -e "Running CodexNetDeployer\n"
bash "${DEPLOYMENT_CODEXNETDEPLOYER_PATH}"/"${DEPLOYMENT_CODEXNETDEPLOYER_RUNNER}"
echo
2024-11-28 19:57:28 +02:00
echo -e "Running continuous-tests\n"
bash "${CONTINUOUS_TESTS_FOLDER}"/"${CONTINUOUS_TESTS_RUNNER}"
else
2024-11-28 19:57:28 +02:00
echo -e "Running ${TESTS_TYPE}\n"
exec "$@"
fi