Files
Ingress/entrypoint-schedule.sh
Matteo Rosati 46ddcc16da dockerize!
2026-01-14 23:54:51 +01:00

37 lines
994 B
Bash

#!/bin/sh
set -e
# Validate required environment variables
if [ -z "$ENDPOINT_URL" ]; then
echo "Error: ENDPOINT_URL environment variable is required but not set"
exit 1
fi
if [ -z "$MONGO_URI" ]; then
echo "Error: MONGO_URI environment variable is required but not set"
exit 1
fi
if [ -z "$DB_NAME" ]; then
echo "Error: DB_NAME environment variable is required but not set"
exit 1
fi
if [ -z "$COLLECTION_NAME" ]; then
echo "Error: COLLECTION_NAME environment variable is required but not set"
exit 1
fi
# Display configuration (without sensitive data)
echo "Starting schedule script with configuration:"
echo " ENDPOINT_URL: ${ENDPOINT_URL}"
echo " MONGO_URI: [REDACTED]"
echo " DB_NAME: ${DB_NAME}"
echo " COLLECTION_NAME: ${COLLECTION_NAME}"
echo ""
# Run the schedule script
# Using exec to replace the shell process with the Python process
# This ensures proper signal handling (SIGTERM, SIGINT) and exit code propagation
exec python schedule.py