Deployment of Source Code on Openshift

In the previous article, sour code was converted to docker image and showed how to deploy that image. This article is about how to deploy source code on openshift. The docker image was deployed via DockerHub. This time github and the same spring project will be used for this deployment.

To do that, first enter the openshift web console.

Web Console

In web console click Red Hat OpenJDK 8. Click Next button for passing information section.

Web Console

After fill in the blanks, click create.

Web Console

Click close button. That’s it. The project is ready to use. The result is shown at below.

Web Console
Web Console
Web Console

Deployment Source Code on Openshift with Using Terminal

Source code deployment was shown via an openshift web console. Now let’s make same deployment via windows terminal.

Open a windows terminal and find oc.exe file. After the .exe file is run, login openshift.

Create a project when the process of login is finished. After that, write oc import-image — from=registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift s2i-java — confirm .

Web Console

To pull the code from github, write oc new-app s2i-java~https://github.com/username/repository name — name=name_choice .

Web Console

To show the application’s status, terminal or web console can be used.

Web Console

This deployment was not performed by the web console. Because of this route has to be given. After the route process, this project can start to work.

Web Console