Let’s say you want to make your own Sushiweb website. You need to rebuild your own container from the application sources with your modifications. Luckily, Openshift provides several features to help you in the build process and delivery of the application to the end users
In the following exercise you will pull the Sushiweb source code from Github, then build and deploy the container image in your Openshift cluster. Once the website is deployed you will pull a new development version from Github and live update your running pods.
The Sushiweb website sources are hosted on Github, you can check the directory structure of the project with this URL: https://github.com/geoffrey-pascal/sushiweb
As you can see, this project contains a Dockerfile file describing how to build the image of the application. Openshift can automatically run this file, build a container image and push it to its private registry.
-
First, go back to the
Developerview and thenTopology. -
Ensure, the project:
user1-sushiis selected.
- Click
+AddandFrom Dockerfile
Enter https://github.com/geoffrey-pascal/sushiweb for the Git Repo URL.
-
Click
Show advanced Git optionsand putubi8in theGit referencefield -
Scroll down, set the name to
sushiweb-sourcesand clickCreate. -
Click on
sushiweb-sourcesto check the Deployment status
When the pod is in Running. state, click the link to the route, check your website availability:
You will be connected to the deployed web site.
- In the OpenShift web console, click
Developer / Topologyin the left Pane.
- Click on
sushiweb-sourcesto display the Deployment, select theDetailstab.
Now Scale your application from 1 pod to 3 pods
- Switch to the
Resourcestab:
You should now see 3 pods deployed and can access to the logs of each pod:
You can see your 3 pods are serving requests in parallel.
Let’s say a developer has created a new version of Sushiweb v1.0 and your job is to deploy this updated version.
Check GitHub to discover the new branch: https://github.com/geoffrey-pascal/sushiweb/branches
-
Click on
Buildsand select thesushiweb-sourcesbuild. -
Click
Edit Build Configin the upper right corner:
- The git field contains the URI to the remote Git repository of the source code, to check out a specific Git, replace the line
ref: ubi8withref: v1.0after theuri: 'https://github.com/geoffrey-pascal/sushiweb'. This branch contains the new development version of Sushiweb, clickSave
- Click
Start buildto start the build process again:
In the OpenShift web console, click Topology in the left pane.
Click on sushiweb-sources to display the sushiweb-sources Deployment, select the Resources tab.
There are 2 Builds in complete status, click on View logs to see the log stream.
Check the new website deployed. You may need to refresh your browser cache to see the updated content (The headings of the website should be displayed in blue).











