Skip to content

Commit

Permalink
Distgen generated content
Browse files Browse the repository at this point in the history
  • Loading branch information
hrnciar authored and frenzymadness committed Jun 28, 2024
1 parent 49f6d49 commit 4ccd56f
Show file tree
Hide file tree
Showing 23 changed files with 119 additions and 7 deletions.
13 changes: 13 additions & 0 deletions 2.7/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
13 changes: 13 additions & 0 deletions 3.11-minimal/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
2 changes: 1 addition & 1 deletion 3.11-minimal/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,micropipenv,standalone-custom-pypi-index}-test-app)
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,micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version,micropipenv-requirements,poetry-src-layout}-test-app)
declare -a MINIMAL_WEB_APPS=()
declare -a WEB_APPS=(${COMMON_WEB_APPS[@]} ${MINIMAL_WEB_APPS[@]})
Expand Down
13 changes: 13 additions & 0 deletions 3.11/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
2 changes: 1 addition & 1 deletion 3.11/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,micropipenv,standalone-custom-pypi-index}-test-app)
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,micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version,micropipenv-requirements,poetry-src-layout}-test-app)
declare -a MINIMAL_WEB_APPS=()
declare -a WEB_APPS=(${COMMON_WEB_APPS[@]} ${FULL_WEB_APPS[@]})
Expand Down
13 changes: 13 additions & 0 deletions 3.12/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
2 changes: 1 addition & 1 deletion 3.12/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,micropipenv,standalone-custom-pypi-index}-test-app)
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,micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version,micropipenv-requirements,poetry-src-layout}-test-app)
declare -a MINIMAL_WEB_APPS=()
declare -a WEB_APPS=(${COMMON_WEB_APPS[@]} ${FULL_WEB_APPS[@]})
Expand Down
13 changes: 13 additions & 0 deletions 3.6/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
2 changes: 1 addition & 1 deletion 3.6/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,micropipenv,standalone-custom-pypi-index}-test-app)
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,micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version,micropipenv-requirements,poetry-src-layout}-test-app)
declare -a MINIMAL_WEB_APPS=()
declare -a WEB_APPS=(${COMMON_WEB_APPS[@]} ${FULL_WEB_APPS[@]})
Expand Down
13 changes: 13 additions & 0 deletions 3.8/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
2 changes: 1 addition & 1 deletion 3.8/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,micropipenv,standalone-custom-pypi-index}-test-app)
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,micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version,micropipenv-requirements,poetry-src-layout}-test-app)
declare -a MINIMAL_WEB_APPS=()
declare -a WEB_APPS=(${COMMON_WEB_APPS[@]} ${FULL_WEB_APPS[@]})
Expand Down
13 changes: 13 additions & 0 deletions 3.9-minimal/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
2 changes: 1 addition & 1 deletion 3.9-minimal/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,micropipenv,standalone-custom-pypi-index}-test-app)
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,micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version,micropipenv-requirements,poetry-src-layout}-test-app)
declare -a MINIMAL_WEB_APPS=()
declare -a WEB_APPS=(${COMMON_WEB_APPS[@]} ${MINIMAL_WEB_APPS[@]})
Expand Down
13 changes: 13 additions & 0 deletions 3.9/s2i/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ function maybe_run_in_init_wrapper() {
fi
}

# Look for gunicorn>=20.1.0 to utilize gunicorn.conf.py
if is_gunicorn_installed && [[ -f "gunicorn.conf.py" ]]; then
ret=$(python -c 'import gunicorn
ver = gunicorn.version_info
print(0 if ver[0]>=21 or (ver[0] == 20 and ver[1] >= 1) else 1)')
grep -q "wsgi_app" gunicorn.conf.py && grep_result=0 || grep_result=1
if [[ $ret -eq 0 ]] && [[ $grep_result -eq 0 ]]; then
echo "---> Using gunicorn.conf.py"
echo "---> Serving application with gunicorn ..."
exec gunicorn
fi
fi

APP_HOME=$(readlink -f "${APP_HOME:-.}")
# Change the working directory to APP_HOME
PYTHONPATH="$(pwd)${PYTHONPATH:+:$PYTHONPATH}"
Expand Down
2 changes: 1 addition & 1 deletion 3.9/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,micropipenv,standalone-custom-pypi-index}-test-app)
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,micropipenv,standalone-custom-pypi-index,gunicorn-python-configfile-different-port}-test-app)
declare -a FULL_WEB_APPS=({setup-cfg,npm-virtualenv-uwsgi,mod-wsgi,pin-pipenv-version,micropipenv-requirements,poetry-src-layout}-test-app)
declare -a MINIMAL_WEB_APPS=()
declare -a WEB_APPS=(${COMMON_WEB_APPS[@]} ${FULL_WEB_APPS[@]})
Expand Down

0 comments on commit 4ccd56f

Please sign in to comment.