feat: Added development server when the `DEVELOPMENT` env var is set

Development server will restart when extensions files are changed
This commit is contained in:
Maicol Battistini 2024-07-16 20:59:00 +02:00
parent d7ee7d66f3
commit 19b56d3750
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,8 @@
# Information about how it works: https://github.com/okfn/ckanext-envvars # Information about how it works: https://github.com/okfn/ckanext-envvars
# Note that variables here take presedence over build/up time variables in .env # Note that variables here take presedence over build/up time variables in .env
DEVELOPMENT=true
# Set to true to disable CKAN from starting and serve a maintenance page # Set to true to disable CKAN from starting and serve a maintenance page
MAINTENANCE_MODE=false MAINTENANCE_MODE=false

View File

@ -61,6 +61,13 @@ then
done done
fi fi
# Enable development server if in development mode
echo "DEVELOPMENT MODE: $DEVELOPMENT"
if [ "$DEVELOPMENT" = true ]; then
echo "Starting development server"
ckan -c $APP_DIR/production.ini run -H 0.0.0.0
fi
# Check whether http basic auth password protection is enabled and enable basicauth routing on uwsgi respecfully # Check whether http basic auth password protection is enabled and enable basicauth routing on uwsgi respecfully
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then