Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOpsSchool!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Openshift: Lab 11 – Build your application from source code

In this lesson, you will:

  • Set up your Developer Sandbox
  • Set up a cluster
  • Build the application from source code

Get that cluster

Once you’ve secured your own cluster, select Start using your sandbox to begin your future (Figure 1).

Select Start using your sandbox.
Figure 1: Select Start using your sandbox.

 Build the application from source code

To build your application using source code from a GitHub repository (repo), start by switching to the Developer view in your OpenShift dashboard (Figure 2).

The Developer view in your OpenShift dashboard.
Figure 2: The Developer view in your OpenShift dashboard.

Next, select +Add to display the many options available for adding an application to your cluster (Figure 3).

Select +Add to display the available options.
Figure 3: Select +Add to display the available options.

In our case, we are interested in the Git Repository/Import from Git option. Select Import from Git (Figure 4).

Selecting Import from Git will build an application from your source code.
Figure 4: Selecting Import from Git will build an application from your source code.

You will be prompted to enter a URL that points to a Git repo. This is where things get interesting. Red Hat OpenShift will copy the repo to an internal storage location, inspect it, and attempt to discern the import strategy to build it. OpenShift will choose one of the following methods to build the application:

  • Option 1: Using the Builder image for the programming language used (i.e., the s2i option).
  • Option 2: Using the Dockerfile that is found in the Git repo.
  • Option 3: Using the DevFile that is found in the Git Repo.

Again, we’re focusing on Option 1 right now: Using the Builder image and the s2i technology. The Builder image is determined by inspecting the source code and may be .NET, JBoss, Perl, or one of several other options. Here are some URLs of sample code that you can use for their related languages:

Test your application

Supply the URL and move to the bottom of the page to select the Resource type (Figure 5).

Select the Resource type for advanced options.
Figure 5: Select the Resource type for advanced options.

Select Deployment as the Resource type. Select Create (Figure 6).

Select Deployment as the Resource type.
Figure 6: Select Deployment as the Resource type.

After a few minutes, the ring on your application’s icon will switch from light blue to dark blue, which means it’s ready to go. Select the external link image to see your application in a browser (Figure 7).

Click to launch your app in a browser.
Figure 7: Click to launch your app in a browser.

Congratulations. You’ve built an application from source code. Now it’s time to build your application from a container image.

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x