Write a Dockerfile and run oc new-app /path/to/Dockerfile, that’s it!! But if you want implement a full fledged modern CI/CD using Jenkins and openshift, you need to do little more than that. So let’s dive into it. Deployment structure In this deployment, our python program will be running inside a container. That program will be served through a Gunicorn server. We will reverse proxy this server from NGINX, running in the same container. The following diagram shows our application structure: The OpenShift Cluster will have three project spaces, CI/CD, DEV and STAGE. CI/CD will contain the Jenkins file, running pipelines inside it. DEV and STAGE projects will have applications running inside them. Next diagram will show what we intend to do in this CI/CD project:
For implementing this CI/CD project, we need to prepare few things beforehand. Let us go through them one by one.
NB: if you have a python application, which runs through gunicorn and has tests runable through nosetests(or any xml test result exporter) then please skip this section.