Browse files

old stuff, unneeded with diy cartridge

  • Loading branch information...
1 parent a3ab1e8 commit d8112e668d34ddbc17b63fc21d3097b9c8c2ab4f giulivo committed Apr 2, 2012
Showing with 31 additions and 95 deletions.
  1. +1 −0 .gitignore
  2. +0 −7 .openshift/markers/README
  3. +30 −32 README
  4. 0 data/.gitkeep
  5. 0 libs/.gitkeep
  6. +0 −10
  7. +0 −34 wsgi/application
  8. +0 −12 wsgi/static/README
@@ -1,2 +1,3 @@
@@ -1,7 +0,0 @@
-Adding marker files to this directory will have the following effects:
-force_clean_build - Will remove the python virtualenv and force rebuild it
- including any previously downloaded libraries
@@ -1,54 +1,52 @@
Feel free to change or remove this file, it is informational only.
+Get started
+1. Add framework of choice to your repo.
+2. Modify .openshift/action_hooks/start to start your application.
+ The application is required to bind to $OPENSHIFT_INTERNAL_IP:8080.
+3. Modify .openshift/action_hooks/stop to stop your application.
+4. Commit and push your changes.
Repo layout
-wsgi/ - Externally exposed wsgi code goes
-wsgi/static/ - Public static content gets served here
-libs/ - Additional libraries
-data/ - For not-externally exposed wsgi code - Standard, specify deps here
-../data - For persistent data (also env var: OPENSHIFT_DATA_DIR)
+static/ - Externally exposed static content goes here
+../data - For persistent data (full path in environment var: OPENSHIFT_DATA_DIR)
+.openshift/action_hooks/start - Script that gets run to start your application
+.openshift/action_hooks/stop - Script that gets run to stop your application
.openshift/action_hooks/pre_build - Script that gets run every git push before the build
.openshift/action_hooks/build - Script that gets run every git push as part of the build process (on the CI system if available)
.openshift/action_hooks/deploy - Script that gets run every git push after build but before the app is restarted
.openshift/action_hooks/post_deploy - Script that gets run every git push after the app is restarted
+Notes about layout
+Please leave the static directory in place (alter but do not delete) but feel
+free to create additional directories if needed.
+Note: Every time you push, everything in your remote repo dir gets recreated
+please store long term items (like an sqlite database) in ../data which will
+persist between pushes of your repo.
Environment Variables
OpenShift Express provides several environment variables to reference for ease
of use. The following list are some common variables but far from exhaustive:
- os.environ['OPENSHIFT_APP_NAME'] - Application name
- os.environ['OPENSHIFT_APP_DIR'] - Application dir
- os.environ['OPENSHIFT_DATA_DIR'] - For persistent storage (between pushes)
- os.environ['OPENSHIFT_TMP_DIR'] - Temp storage (unmodified files deleted after 10 days)
-When embedding a database using rhc-ctl-app, you can reference environment
-variables for username, host and password:
- os.environ['OPENSHIFT_DB_HOST'] - DB host
- os.environ['OPENSHIFT_DB_PORT'] - DB Port
- os.environ['OPENSHIFT_DB_USERNAME'] - DB Username
- os.environ['OPENSHIFT_DB_PASSWORD'] - DB Password
+ $_ENV['OPENSHIFT_INTERNAL_IP'] - IP Address assigned to the application
+ $_ENV['OPENSHIFT_GEAR_NAME'] - Application name
+ $_ENV['OPENSHIFT_GEAR_DIR'] - Application dir
+ $_ENV['OPENSHIFT_DATA_DIR'] - For persistent storage (between pushes)
+ $_ENV['OPENSHIFT_TMP_DIR'] - Temp storage (unmodified files deleted after 10 days)
To get a full list of environment variables, simply add a line in your
.openshift/action_hooks/build script that says "export" and push.
-Notes about layout
-Please leave wsgi, libs and data directories but feel free to create additional
-directories if needed.
-Note: Every time you push, everything in your remote repo dir gets recreated
-please store long term items (like an sqlite database) in ../data which will
-persist between pushes of your repo.
-Notes about
+Additional information
-Adding deps to the install_requires will have the openshift server actually
-install those deps at git push time.
+Link to additional information will be here, when we have it :)
No changes.
No changes.
@@ -1,10 +0,0 @@
-from setuptools import setup
- version='1.0',
- description='Tornado on openShift App',
- author='Giulio Fidente',
- author_email='',
- url='',
- install_requires=['tornado>=2.2'],
- )
@@ -1,34 +0,0 @@
-import os
-virtenv = os.environ['APPDIR'] + '/virtenv/'
-os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python2.6/site-packages')
-virtualenv = os.path.join(virtenv, 'bin/')
- execfile(virtualenv, dict(__file__=virtualenv))
-except IOError:
- pass
-# IMPORTANT: Put any additional includes below this line. If placed above this
-# line, it's possible required libraries won't be in your searchable path
-import tornado.wsgi
-import tornado.web
-class MainHandler(tornado.web.RequestHandler):
- def get(self):
- self.write("Hello, world")
-application = tornado.wsgi.WSGIApplication([
- (r"/", MainHandler),
-# Below for testing only
-if __name__ == '__main__':
- from wsgiref.simple_server import make_server
- httpd = make_server('localhost', 8051, application)
- # Wait for a single request, serve it and quit.
- httpd.handle_request()
@@ -1,12 +0,0 @@
-Public, static content goes here. Users can create rewrite rules to link to
-content in the static dir. For example, django commonly uses /media/
-directories for static content. For example in a .htaccess file in a
-wsgi/.htaccess location, developers could put:
-RewriteEngine On
-RewriteRule ^application/media/(.+)$ /static/media/$1 [L]
-Then copy the media/* content to yourapp/wsgi/static/media/ and it should
-just work.
-Note: The ^application/ part of the URI match is required.

0 comments on commit d8112e6

Please sign in to comment.