Initial commit
This commit is contained in:
parent
c785944bae
commit
a3e6c67270
35 changed files with 1152 additions and 0 deletions
1
test/virtualenv-uwsgi-test-app/.s2i/environment
Normal file
1
test/virtualenv-uwsgi-test-app/.s2i/environment
Normal file
|
|
@ -0,0 +1 @@
|
|||
UPGRADE_PIP_TO_LATEST=1
|
||||
29
test/virtualenv-uwsgi-test-app/app.sh
Executable file
29
test/virtualenv-uwsgi-test-app/app.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# First test virtualenv environment and pip upgrade
|
||||
|
||||
echo "Testing that the virtual environment's Python is being used ..."
|
||||
if [ "$(which python)" != "/opt/app-root/bin/python" ]; then
|
||||
echo "ERROR: Initialization of the virtual environment failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Testing UPGRADE_PIP_TO_LATEST=1 (set in .s2i/environment) ..."
|
||||
pip_major_version=$(pip --version | cut -d" " -f2 | cut -d"." -f1)
|
||||
if [ -z "$pip_major_version" ] || [ "$pip_major_version" -lt "9" ]; then
|
||||
echo "ERROR: Failed to upgrade pip to version 9 or later."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Now test the uwsgi server
|
||||
|
||||
exec uwsgi \
|
||||
--http-socket :8080 \
|
||||
--die-on-term \
|
||||
--master \
|
||||
--single-interpreter \
|
||||
--enable-threads \
|
||||
--threads=5 \
|
||||
--thunder-lock \
|
||||
--module wsgi
|
||||
2
test/virtualenv-uwsgi-test-app/requirements.txt
Normal file
2
test/virtualenv-uwsgi-test-app/requirements.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
uWSGI
|
||||
Flask
|
||||
9
test/virtualenv-uwsgi-test-app/wsgi.py
Normal file
9
test/virtualenv-uwsgi-test-app/wsgi.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from flask import Flask
|
||||
application = Flask(__name__)
|
||||
|
||||
@application.route('/')
|
||||
def hello():
|
||||
return b'Hello World from uWSGI hosted WSGI application!'
|
||||
|
||||
if __name__ == '__main__':
|
||||
application.run()
|
||||
Loading…
Add table
Add a link
Reference in a new issue