cs-codex-dist-tests/docker/docker-entrypoint.sh

36 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2023-05-28 19:48:33 +00:00
#!/bin/bash
# Common
2023-05-28 19:48:33 +00: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 19:48:33 +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
# Get code
echo "`date` - Clone ${SOURCE}"
2023-05-28 19:48:33 +00:00
git clone -b "${BRANCH}" "${SOURCE}" "${FOLDER}"
echo "`date` - Change folder to ${FOLDER}"
2023-05-28 19:48:33 +00:00
cd "${FOLDER}"
# Run
echo "Run tests from branch '`git branch --show-current` / `git rev-parse HEAD`'"
2023-05-28 19:48:33 +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