Update start_staging script for app-only - no sidekiq container support owing to embedded status

pull/544/head
Mikhael Rakauskas 4 months ago
parent df815d52d9
commit f33aa57d36

@ -175,8 +175,6 @@ set_environment() {
# Main execution # Main execution
main() { main() {
local command=${1:-api}
cd ../../app/ cd ../../app/
set_environment set_environment
@ -184,7 +182,6 @@ main() {
check_aws_setup check_aws_setup
echo "Starting CP Docuseal in staging mode..." echo "Starting CP Docuseal in staging mode..."
echo "Command: $command"
echo "Rails Environment: ${RAILS_ENV:-staging}" echo "Rails Environment: ${RAILS_ENV:-staging}"
# Fetch database credentials from Secrets Manager # Fetch database credentials from Secrets Manager
@ -199,22 +196,15 @@ main() {
# Load updated environment variables # Load updated environment variables
set_environment set_environment
# Setup and migrate database (only for API command) # Setup and migrate database
if [ "$command" = "api" ]; then setup_database
setup_database
echo "=== Startup Complete - Starting Rails Server ===" echo "=== Startup Complete - Starting Rails Server ==="
echo "Database Host: ${DB_HOST:-not set}" echo "Database Host: ${DB_HOST:-not set}"
echo "Database Port: ${DB_PORT:-not set}" echo "Database Port: ${DB_PORT:-not set}"
# Start the Rails server
exec ./bin/rails server -b 0.0.0.0 -p "${PORT:-3000}" # Start the Rails server
elif [ "$command" = "sidekiq" ]; then exec ./bin/rails server -b 0.0.0.0 -p "${PORT:-3000}"
echo "=== Startup Complete - Starting Sidekiq ==="
# Start Sidekiq
exec bundle exec sidekiq -q default
else
echo "ERROR: Unknown command '$command'. Use 'api' or 'sidekiq'"
exit 1
fi
} }
# Execute main function with all arguments # Execute main function with all arguments

Loading…
Cancel
Save