logos-storage-nim-cs-dist-t.../docker/docker-entrypoint.sh
E M 5bfbf11013
ci: pre-place openapi.yaml in runner pods via an initContainer
When running in CI, the runner pod does not have access to a Docker daemon,
so the StoragePlugin build cannot extract openapi.yaml from the storage image
itself. Each test job now runs an initContainer on the image under test
(STORAGEDOCKERIMAGE) that copies /logosstorage/openapi.yaml into a shared
volume; the entrypoint then places it into ProjectPlugins/LogosStorageClient
before the build.

run-dist-tests.yaml gains a STORAGEDOCKERIMAGE default so its job manifest
can resolve the initContainer image like the release and continuous jobs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 16:39:42 +10:00

37 lines
1.3 KiB
Bash

#!/bin/bash
# Variables
## Common
SOURCE="${SOURCE:-https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git}"
BRANCH="${BRANCH:-master}"
FOLDER="${FOLDER:-/opt/logos-storage-dist-tests}"
## Tests specific
CONTINUOUS_TESTS_FOLDER="${CONTINUOUS_TESTS_FOLDER:-Tests/LogosStorageContinuousTests}"
CONTINUOUS_TESTS_RUNNER="${CONTINUOUS_TESTS_RUNNER:-run.sh}"
# Get code
echo -e "Cloning ${SOURCE} to ${FOLDER}\n"
git clone -b "${BRANCH}" "${SOURCE}" "${FOLDER}"
echo -e "\nChanging folder to ${FOLDER}\n"
cd "${FOLDER}"
# Place the openapi.yaml that the job's initContainer extracted from the storage image
# into the client project. This pod has no Docker daemon, so the StoragePlugin build
# consumes this file instead of extracting it itself (see ProjectPlugins/LogosStorageClient).
if [[ -f /shared/openapi.yaml ]]; then
echo -e "Using openapi.yaml extracted from the storage image by the initContainer\n"
cp /shared/openapi.yaml ProjectPlugins/LogosStorageClient/openapi.yaml
fi
# Run tests
echo -e "Running tests from branch '$(git branch --show-current) ($(git rev-parse --short HEAD))'\n"
if [[ "${TESTS_TYPE}" == "continuous-tests" ]]; then
echo -e "Running continuous-tests\n"
bash "${CONTINUOUS_TESTS_FOLDER}"/"${CONTINUOUS_TESTS_RUNNER}"
else
echo -e "Running ${TESTS_TYPE}\n"
exec "$@"
fi