OpenShift Python project for Cloud Computing Exercise #4
This is a hello world Python project that deploys on RedHat's OpenShift Developer Preview.
-
Register with OpenShift using Github credentials at https://api.preview.openshift.com/
-
Open the OpenShift console: https://console.preview.openshift.com/console/
-
Create a new Project
-
We're going to add a Python component to your project. First, you need a Github repo. You're welcome to fork this repo if you like. The important files are:
- app.py - must start a service that listens on port 8080 forever
- requirements.txt - list of Python dependencies
-
Back to the OpenShift console, Add new Python2.7 component with your github repo's url
-
Add OpenShift's webhook url to your github repo
-
Back to the OpenShift console, wait for your project to rebuild, then click the link in the upper right corner of the screen. That should be your application printing "Hello World". Congratulations!
-
Clone your repo locally, change app.py and push the changes. OpenShift will automatically rebuild it using the webhook you added earlier.
There's a command-line interface too, at https://console.preview.openshift.com/console/command-line. You can get a token to log in at https://api.preview.openshift.com/oauth/token/request
Cheers!