diff --git a/examples/gunicorn-using-configfile-test-app b/examples/gunicorn-using-configfile-test-app new file mode 160000 index 00000000..d0b2bbc5 --- /dev/null +++ b/examples/gunicorn-using-configfile-test-app @@ -0,0 +1 @@ +Subproject commit d0b2bbc598ff093ed0e3c466ade0f2163f8fc91e diff --git a/src/s2i/bin/run b/src/s2i/bin/run index 2a982cd1..78e10d47 100755 --- a/src/s2i/bin/run +++ b/src/s2i/bin/run @@ -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)" diff --git a/test/run b/test/run index f0d50c67..6bf121de 100755 --- a/test/run +++ b/test/run @@ -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 %}