2023-05-28 19:48:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-11-06 13:09:51 +00:00
|
|
|
# Common
|
2023-05-28 19:48:33 +00:00
|
|
|
SOURCE="${SOURCE:-https://github.com/codex-storage/cs-codex-dist-tests.git}"
|
|
|
|
BRANCH="${BRANCH:-master}"
|
2023-11-06 13:09:51 +00:00
|
|
|
FOLDER="${FOLDER:-/opt/cs-codex-dist-tests}"
|
2023-05-28 19:48:33 +00:00
|
|
|
|
2023-11-06 13:09:51 +00:00
|
|
|
# Continuous Tests
|
|
|
|
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 19:48:33 +00:00
|
|
|
|
2023-11-06 13:09:51 +00:00
|
|
|
|
|
|
|
# Get code
|
|
|
|
echo "`date` - Clone ${SOURCE}"
|
2023-05-28 19:48:33 +00:00
|
|
|
git clone -b "${BRANCH}" "${SOURCE}" "${FOLDER}"
|
2023-11-06 13:09:51 +00:00
|
|
|
echo "`date` - Change folder to ${FOLDER}"
|
2023-05-28 19:48:33 +00:00
|
|
|
cd "${FOLDER}"
|
|
|
|
|
|
|
|
# Run
|
2023-11-06 13:09:51 +00:00
|
|
|
echo "Run tests from branch '`git branch --show-current` / `git rev-parse HEAD`'"
|
2023-05-28 19:48:33 +00:00
|
|
|
|
2023-11-06 13:09:51 +00:00
|
|
|
if [[ "${TESTS_TYPE}" == "continuous-tests" ]]; then
|
|
|
|
echo "`date` - Running Continuous Tests"
|
|
|
|
echo
|
|
|
|
echo "`date` - Running CodexNetDeployer"
|
|
|
|
bash "${DEPLOYMENT_CODEXNETDEPLOYER_PATH}"/"${DEPLOYMENT_CODEXNETDEPLOYER_RUNNER}"
|
|
|
|
echo
|
|
|
|
echo "`date` - Running Tests"
|
|
|
|
bash "${CONTINUOUS_TESTS_FOLDER}"/"${CONTINUOUS_TESTS_RUNNER}"
|
|
|
|
else
|
|
|
|
echo "`date` - Running Dist Tests"
|
|
|
|
exec "$@"
|
|
|
|
fi
|