Skip to content

Commit

Permalink
Allow the usage of gunicorn.conf.py config file in gunicorn applications
Browse files Browse the repository at this point in the history
Fixes: sclorg#599
  • Loading branch information
hrnciar committed Jun 3, 2024
1 parent cea86df commit 7b7a505
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/gunicorn-using-configfile-test-app
Submodule gunicorn-using-configfile-test-app added at d0b2bb
7 changes: 6 additions & 1 deletion src/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,13 @@ fi

if is_gunicorn_installed; then
setup_py=$(find "$HOME" -maxdepth 2 -type f -name 'setup.py' -print -quit)
# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
$(rpmdev-vercmp $(rpm -q --queryformat '%{VERSION}' python3-gunicorn) "20.1.0")
vercmp_result=$?
if [[ $ver -eq 11 || $ver -eq 0 ]] && [[ -f "gunicorn.conf.py" ]]; then
echo "Using gunicorn.conf.py"
# Look for wsgi module in the current directory
if [[ -z "$APP_MODULE" && -f "./wsgi.py" ]]; then
elif [[ -z "$APP_MODULE" && -f "./wsgi.py" ]]; then
APP_MODULE=wsgi
elif [[ -z "$APP_MODULE" && -f "$setup_py" ]]; then
APP_MODULE="$(python "$setup_py" --name)"
Expand Down
2 changes: 1 addition & 1 deletion test/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# IMAGE_NAME specifies a name of the candidate image used for testing.
# The image has to be available before this script is executed.
#
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index{% endif %}}-test-app)
declare -a COMMON_WEB_APPS=({gunicorn-config-different-port,gunicorn-different-port,gunicorn-with-configfile-app-home-test-app,django-different-port,standalone,setup,setup-requirements,django,numpy,app-home,locale,pipenv,pipenv-and-micropipenv-should-fail,app-module,pyuwsgi-pipenv{% if spec.version.startswith("3.") %},micropipenv,standalone-custom-pypi-index{% endif %}}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version{% if spec.version.startswith("3.") %},micropipenv-requirements,poetry-src-layout{% endif %}}-test-app)
declare -a MINIMAL_WEB_APPS=()
{% if spec.minimal %}
Expand Down

0 comments on commit 7b7a505

Please sign in to comment.