<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nicholas Omorogbe on Medium]]></title>
        <description><![CDATA[Stories by Nicholas Omorogbe on Medium]]></description>
        <link>https://medium.com/@nicholas.omorogbe?source=rss-14ff37258537------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Y40CxEEFVNqCRtXF</url>
            <title>Stories by Nicholas Omorogbe on Medium</title>
            <link>https://medium.com/@nicholas.omorogbe?source=rss-14ff37258537------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:43:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nicholas.omorogbe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Integrate Tomcat Server in CICD Pipeline]]></title>
            <link>https://medium.com/@nicholas.omorogbe/how-to-integrate-tomcat-server-in-cicd-pipeline-4401c804c79f?source=rss-14ff37258537------2</link>
            <guid isPermaLink="false">https://medium.com/p/4401c804c79f</guid>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[tomcat]]></category>
            <dc:creator><![CDATA[Nicholas Omorogbe]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 03:48:36 GMT</pubDate>
            <atom:updated>2023-10-13T03:48:36.634Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3-W32zV2UeY7sHkJ8qOPA.png" /></figure><p>In this blog, you can get an idea of how to deploy an artifact on a Tomcat server, it&#39;s a simple job Integrating Apache Tomcat server into a Continuous Integration/Continuous Deployment (CICD) pipeline involves automating the deployment and management of your web application on the Tomcat server.</p><p>In this example, Maven is used to build the application and generate a WAR file. The WAR file is then deployed to the Tomcat server.<strong> </strong>For that have to set up a CI/CD pipeline with Github, Jenkins, Maven, and Tomcat.</p><h3>A step-by-step guide to Deploying Artifacts on a Tomcat Server</h3><p>Deploying artifacts on a Tomcat server typically involves deploying web applications (WAR files) onto the Tomcat container. Here’s a step-by-step guide to deploying artifacts on a Tomcat server:</p><p>✳️ Prepare your artifact</p><p>✳️ Access Tomcat Manager</p><p>✳️ Access the Tomcat Manager URL</p><p>✳️ Login Tomcat</p><p>✳️ Deploy the Artifact</p><p>✳️ Monitor Deployment</p><p>✳️ Access your application</p><p>Let&#39;s dive into the detailed view of how to deploy the artifact in the target environment which we using here as a Tomcat server.</p><h3>Table of Contents:</h3><p>📌Create EC2 instance</p><p>📌Installation of Java</p><p>📌 Configure Tomcat</p><p>📌 Start Tomcat Server</p><p>📌 Setup Jenkins Job to deploy code on the Tomcat server</p><p>📌Access web UI on port 8080</p><p><strong>Installation of Java:</strong></p><p><strong>Step 1:</strong> Create an EC2 instance and SSH into the EC2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aBSqmwoUxYZto8-CccMpMQ.png" /></figure><p><strong>Step 2: </strong>To install the Tomcat server, primarily we need to install Java using the command:</p><pre>sudo apt install default-jdk<br>sudo apt install default-jre</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLyDLN0Aaj2Emml0NqQeFA.png" /></figure><p><strong>Step 3:</strong> Next, in the setup of the Tomcat Server, have to get the tomcat download link from the website <a href="https://tomcat.apache.org/download-90.cgi">URL</a>.</p><p>Copy the latest version of the Tomcat 9 link tar.gz file shown in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0sa67xQjqrPnDvWHPIvgVA.png" /></figure><p><strong>Step 4:</strong> Using the command</p><pre>wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.81/bin/apache-tomcat-9.0.81.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1de1F3Y-O62B0Mn4aSFvcg.png" /></figure><p><strong>Step 5: </strong>Unzip/extract the .tar file using the command “tar –xvzf &lt;file name&gt;”</p><pre>tar –xvzf &lt;file name&gt;<br>tar -xvzf  apache-tomcat-9.0.81.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jq1Cp5shfD-lfx7OZRmdtg.png" /></figure><p><strong>Step 6: </strong>After extracting, This is optional, if required you can change the name using the command mv &lt;oldname&gt; &lt;newname&gt;</p><pre>mv &lt;oldname&gt; &lt;newname&gt;<br>mv  mv apache-tomcat-9.0.81 tomcat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*buYWRB8unz39HiY6CiKW_A.png" /></figure><p><strong>Step 7:</strong> Now go inside Tomcat and within that, we have a bin directory to start the Tomcat services.</p><p>In the bin directory, if you listed you get the startup.sh script which we need to run “./startup.sh” to start the tomcat services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d7GUtscOw5sQN9yRsRMsVw.png" /></figure><p>Tomcat started successfully. We can check it in browser via port 8080</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DbxLnH1Ytgwm49EfDIeN0w.png" /></figure><p><strong>Step 8: </strong>On the Tomcat web page, click on <strong>Manager APP </strong>and log in with your login username and password which we created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ae-2pZbGsFdHrSnBr8vDIw.png" /></figure><p><strong>Step 9:</strong> Next have to integrate Tomcat with Jenkins to deploy the code in the Tomcat server. First, need to install plugins and then configure Tomcat.</p><p><strong>Step 10:</strong> Install Deploy to Container plugins. To install plugins go to “manage Jenkins” search for the available plugins “deploy to container” and install it without restart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PA_d9kzx8SIyS977aZyN-g.png" /></figure><p><strong>Step 11:</strong> Next to Configure Tomcat server with credentials, again go to manage Jenkins then click on credentials in that click on “Global Credentials” Here you can add new credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PWkcgWqTELGkdU4RSme_xg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5XeGlYOpZqP8HD7XdRY1A.png" /></figure><p><strong>Step 12:</strong> Next have to create a new job to deploy the code on the Tomcat server. I have created the job in the name of BuildAndDeployJob. In creating a job have selected the maven project, then updated the git repository URL in SCM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xWmx-xBVgrV3Ylcyv6_sZA.png" /></figure><p>Update the GitHub URL where the code is available to deploy in the Tomcat server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ynsgXoroBuMytPa8qpMekQ.png" /></figure><p><strong>Step 13</strong>: Copy the URL from your GitHub account, mine is <a href="https://github.com/Nosa213/hello-world.git">https://github.com/Nosa213/hello-world.git</a>, and paste it into the Repository URL. We do not require any credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xyzyjBUQnA7jyGRTWELy7A.png" /></figure><p><strong>Step 14:</strong> Set the goals as clean and install, clean the previous build-cache information, and install.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OEE-PsAHeZ8J1LfzMk5emA.png" /></figure><p><strong>Step 15: To locate the WAR/EAR file run the following commands</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_e1QE6JlGqOFdcCGnec6JQ.png" /></figure><p><strong>Step 16: </strong>Next click on <strong>post-build</strong> actions, where we can deploy our code on the Tomcat server. Under<strong> post-build</strong> actions choose<strong> </strong>Deploy war/ear to a container. This option is to be enabled because we have already installed deploy to the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jQKKx-8mqmLWJ0asLW3WAg.png" /></figure><p>We can give the full path of the .war file or else mention WAR/EAR files to deploy. Relative to the workspace root. You can also specify Any-style GLOBs, like “<strong>**/*.war</strong>” so that it will be wherever the file is available.</p><p><strong>Step 17: Next add the containers choose </strong>Tomcat 8.x Remote then add credentials that we already added to the deployed container and Tomcat URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aSVsCpzz7tB2YFg-4BMRDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xjwe-WwnxMIEdb-quAZWag.png" /></figure><p><strong>Step 17:</strong> Finally click on Apply and save the details then click on Build Now to build the created job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DdmB3D68SnFrKbBRHoXAPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejbRj83hg9Iy1z6OY18onw.png" /></figure><p><strong>Step 18: </strong>Job successfully created the same can be seen in Build history. The same you can check in the Tomcat server where the artifact webapp.war file is available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/0*r4qMlE8obc9Ghvfs.png" /></figure><p>After successful deployment, you can check the same on the Tomcat webpage, where one more webapp directory was created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqgHaJTkSKj3mcjD-H6cew.png" /></figure><p><strong>Step 18:</strong> If you click on the “webapp” directory it redirects to the deployed app webpage output given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IrYTp7P74dzFWMu7jJ0Itg.png" /></figure><p>I hope you got a complete process on how to deploy a simple HTML code using CICD Pipeline integrated on the Tomcat server.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4401c804c79f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up a CI/CD pipeline using Git, Jenkins, and Maven]]></title>
            <link>https://medium.com/@nicholas.omorogbe/setting-up-a-ci-cd-pipeline-using-git-jenkins-and-maven-af4e667a2e9d?source=rss-14ff37258537------2</link>
            <guid isPermaLink="false">https://medium.com/p/af4e667a2e9d</guid>
            <category><![CDATA[jenkins-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nicholas Omorogbe]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 23:07:47 GMT</pubDate>
            <atom:updated>2023-10-12T23:19:59.518Z</atom:updated>
            <content:encoded><![CDATA[<p>In this project, I’m going to show you how to set up a CI/CD Pipeline using Git, Jenkins, and Maven in AWS Cloud.</p><p><strong>Git</strong>: is a tool that helps developers/engineers who write code to save and manage different versions of their code. It’s like a time machine for code, allowing you to go back to earlier versions if something goes wrong or compare changes made by different people working within the same organization and team.</p><p><strong>Jenkins</strong>: is a tool used by developers/engineers to automate various tasks in the process of building and testing software. It’s like having a robot assistant that can compile code, run tests, and perform other repetitive tasks, making the development process faster and more reliable.</p><p><strong>Maven</strong>: is a tool that helps organize and manage software projects. It keeps track of all the components and libraries a project needs, making it easier for developers/engineers to work together and ensuring that everyone is using the same set of tools and dependencies. It’s like a project manager for software development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5khTqyDcZWzah0tGOLhY8w.png" /></figure><p>Log into your AWS account and create an AWS EC2 instance. The rest of this project will be built on top of the EC2 instance so it is imperative that you get your instance setup properly. If you need help creating and setting up the instance.</p><ul><li><strong>Name</strong>= Jenkins-sever</li><li><strong>Amazon Machine Image(AMI)</strong>: <em>Ubuntu 22.04</em></li><li><strong>Instance type</strong>= <em>t2.micro</em></li><li><strong>Security Group</strong>: Make sure to open ports 22, 80, 8080 under “inbound rules”.(Jenkins server runs on this port by default)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xOHHakelc24wak7KZLUVvw.png" /></figure><p><strong>2.) SSH into EC2 Instance, Install Jenkins</strong></p><ul><li>SSH into the EC2 instance. After securely connecting to the instance, the first thing we have to do is install the Java application onto the instance. Jenkins runs natively runs on the Java application so it has to be properly installed in order for the Jenkins server to be operational.</li></ul><p>Follow these steps through the <a href="https://pkg.jenkins.io/redhat-stable/">link</a> directly below to get Java and Jenkins installed on your instance.</p><pre> curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \<br>    /usr/share/keyrings/jenkins-keyring.asc &gt; /dev/null<br><br>echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \<br>    https://pkg.jenkins.io/debian-stable binary/ | sudo tee \<br>    /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br><br>sudo apt-get update<br>  sudo apt-get install fontconfig openjdk-11-jre<br>  sudo apt-get install jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*OVSbytfjP1IoHz0cpOn9CA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8eyP4c-MmJAySMZvwv94w.png" /></figure><p><strong>Install Jenkins on instance</strong></p><pre>sudo yum install Jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0FxS6sb6jOkJoIXbZJO5g.png" /></figure><p><strong>Start Jenkins server</strong></p><pre>service jenkins start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*AgGEpQwvGXXB2Ghn3bsx1Q.png" /></figure><p><strong>3.) Setting Up Jenkins Server</strong></p><ul><li>Now that the Jenkins server has been officially started on the instance, head over to the AWS Management console, grab the public IP address of the instance, and paste that into your browser address bar followed by:8080</li></ul><p><strong>Example</strong>: 13<strong><em>.113.239.60:8080</em></strong></p><p>Remember that the Jenkins server natively runs on port 8080. If you are having connection issues, double-check your inbound rules in the security group and make sure that you have the right ports open! (<strong><em>port 22 for SSH, port 80 for internet access, and port 8080</em></strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zMjsDbQC1oOLxO6wx65O1g.png" /></figure><p>Display page/Login Window</p><ul><li>You will see the login window displaying the Get started Jenkins page showing the file directory containing the administrator password. Take the directory path and print it out the CLI using the “cat” command.</li><li>Next, copy the administrator password, paste it into the box, and click on continue to move to the next step of the Jenkins setup process.</li></ul><pre>cat /var/lib/jenkins/secrets/initialAdminPassword</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lEQHyi6EFgT7k2U3bM86A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*Jsgf8hpGnv1RuXspA30rEg.png" /></figure><p><strong>Creating our first Jenkins Job</strong></p><ul><li>Click on “<strong>Create a job</strong>” to start building out the first jobs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJmN7kaK2UXVf7lwXhEjkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9b_oNWctLEhRW0pqOsHO6w.png" /></figure><p>For our first job, we are going to give it the name “<strong>HelloWorldJobProject213</strong>” and select the option “<strong>Freestyle Project</strong>”. Click OK to move to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z6vm-HYabdcqcHsYq7f3lg.png" /></figure><p><strong>Under the general configuration settings</strong></p><ul><li>In the description box, enter the text “<strong>HelloWorldJob</strong>”</li><li>Under the “<strong>Source Code Management</strong>” tab select the “<strong>None</strong>” option</li><li>Under the “<strong>Execute shell</strong>” tab we will have Jenkins execute this simple command that will print the text “<strong>Hello World</strong>” and print out the login information, time, and the numbers of users on the server automatically.</li><li>Click Apply and save.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UHhcoT4N5rpp6IjKkiuYlw.png" /></figure><ul><li>Navigate back to the Dashboard and you will see our 1st job in queue ready for the build stage.</li><li>Click on “<strong>Build Now</strong>”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhG5tmZqUyuj71Kr3-OIfw.png" /></figure><ul><li>After a few seconds, you will see the build output under the “<strong><em>build history</em></strong>”</li><li>The console output should display a green checkmark indicating that the build was SUCCESSFUL.</li><li>You can see that the echo “<strong>Hello World</strong>” and uptime commands were properly executed!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHUEErKljZuzs22_nfeSmw.png" /></figure><p><strong>Step 6: Installing Git and Integrating It With Jenkins</strong></p><ul><li>With Jenkins successfully configured we are going to install Git</li></ul><pre>sudo apt install git</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iX8LPfb3JRt3IvFu50EbTQ.png" /></figure><p><strong>Verify Git is installed</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*pOABJdwfB00iTMi4urIBBQ.png" /></figure><p>Navigate to the Jenkins Dashboard and click on “<strong>New item</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4kS7aTW40LyEGc8sJvteeg.png" /></figure><p>Under Manage Jenkins select “<strong>Plugins</strong>”. In order for us to get Git installed and integrate with Jenkins we have to install the GitHub plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdDswEJ-H_9u8cjKbwlN_w.png" /></figure><p><strong>Installation page</strong></p><ul><li>The installation will show all the necessary dependencies needed to run Git.</li><li>At the end of the installation page click on “<strong><em>Go back to the top page</em></strong>”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RffORCZeO7Vm0dr7vNGyBQ.png" /></figure><p>Under Manage Jenkins select “<strong>Global Tools Configuration</strong>” under System Configuration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJ6h2FEcBiJIGAZLlzFvJQ.png" /></figure><p>Navigate down to the “<strong>Git Installations</strong>” area and enter “<strong>Git</strong>” for the name. Apply and save the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVTmepnwxTtO5ui3pIJCHA.png" /></figure><p>Back in the Dashboard under “<strong>New item</strong>” enter “<strong>PullCodeFromGitHub</strong>”. We are going to pull source code from GitHub.</p><ul><li>Select the “<strong>Freestyle Project</strong>” and click on “<strong>OK</strong>”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PmiaRrIpwPPw0CVhtrloZQ.png" /></figure><ul><li>We are going to clone the following repo onto the server REPO:</li><li><a href="https://github.com/Nosa213/hello-world.git">https://github.com/Nosa213/hello-world.git</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZwqkRmbGH4srt_1PLCmeJA.png" /></figure><ul><li><strong>Under Source Code Management</strong></li><li>Select Git</li><li>Paste the Repo URL: <a href="https://github.com/Nosa213/hello-world.git">https://github.com/Nosa213/hello-world.git</a></li><li>Leave the rest of the settings as is and make sure to apply and save the changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p2kbV6F3F93droK84kSB-w.png" /></figure><ul><li><strong>Under Dashboard, you will see a new job for Git.</strong></li><li>Click on “<strong>Build Now</strong>” If the build output shows a green checkmark indicator, that means our build was a <strong>SUCCESS</strong>!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4PV3IAX9Ag6yL6QFneCRQg.png" /></figure><p><strong>Output</strong></p><ul><li>Congratulations the git repo was successfully clone onto the Jenkins server! We now have a properly functioning Jenkins server with Git integration</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGEhs0XR008GH5B0wKrLEA.png" /></figure><ul><li><strong>Verify Git Clone on the Server</strong></li><li>On the CLI verify that all the contents of the repo we cloned are indeed on the server. Navigate to the directory via:</li></ul><pre>cd /var/lib/jenkins/workspace/PullCodeFromGitHubb</pre><ul><li>Files should match the repo. If you do not see anything, come back and redo the git build.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1TlDYxYFsbg0mDT8J5pWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*jtTo6NEK8e8KXZyUV9CeSA.png" /></figure><ul><li><strong>Step 7: Installing and Integrating Maven to Jenkins</strong></li><li>Maven automates the process of building and managing code in both software development as well as in DevOps. Maven manages the build, testing, and packaging of code, making it easy for DevOps teams to produce consistent, reliable, and repeatable builds.</li></ul><pre> cd /opt<br><br>wget https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBnjgt-RbdSMVzUp5tlS8g.png" /></figure><p>After installation, verify that Maven was indeed installed by listing the contents of the directory: If you see the Maven dependency files listed then you know it was successfully installed.</p><pre>ll</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3KIRU3fE1kGU0nEUyQwyYg.png" /></figure><p>By default, the main Maven file(highlighted in red) will be in a zip file. We need to extract it to fully see all the files.</p><pre>tar -xvzf apache-maven-3.9.5-bin.tar.gz<br><br>ll</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qz-TWLXoeGj4wMaUBI8eig.png" /></figure><p>You can choose to keep the default maven file name that is highlighted in blue or change the name of the file. I’m going to change the name to just “<strong>maven</strong>” to keep things simple. To change the name use the “<strong>mv</strong>” command.</p><pre>mv apache-maven-3.9.5 maven</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zY3wS9deN495KwYOgC6nnQ.png" /></figure><p><strong>Setting Up Java Development Kit with Maven</strong></p><p>In the CLI use the following commands:</p><ul><li>We will be in root mode to access the Jdk file</li></ul><pre>sudo su -</pre><ul><li>Change the directory and list the files in it. The first file you see is the Java home directory! Copy the file directory because you are going to paste it into the .bash profile file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8QQFz_u3vIF-hpfv5376g.png" /></figure><ul><li>Open .<strong><em>bash_profile</em></strong> and paste the path to java home in it. Set the path below.</li><li>Under “<strong>PATH</strong>” we are setting the value to the JDK</li><li>Save and close the file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xnbya_rB83ZWgwCZ0FhTJw.png" /></figure><ul><li>To validate changes, enter the following two commands:</li></ul><pre>source .bash_profile<br>#reloads directory with new values<br><br>echo $PATH<br>#shows new java path with maven path and maven server</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ebs87LjQb4kdD6SRJirUcg.png" /></figure><p><strong>Execute Maven server</strong></p><ul><li>Check maven version</li></ul><pre>mvn - v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c1OQaLVtIwSxHc5m7rI4EA.png" /></figure><p><strong>Maven Plugin for Jenkins:</strong></p><ul><li>With the Maven server installed, it is time to set up the Maven plugin in the Jenkins server to complete the integration</li><li>Navigate back to the Jenkins Dashboard, select the “<strong>Manage Jenkins</strong>” option, and select “<strong>Plugins</strong>”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qcktsSUcqw6avY2NPRcumw.png" /></figure><ul><li>Type “<strong>Maven</strong>” and select Maven Integration. Click on Install the plugin.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYMpSCyAKleu3xpxYVtxVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tsNv4PqQti1IBfBu9eggvw.png" /></figure><ul><li>After the installation, navigate back to the Jenkins dashboard.</li><li>Under Manage Jenkins, select the “<strong>Global Configuration</strong>” tab. Since we successfully installed JDK and Maven, you will see the options referencing JDK and Maven.</li><li><strong>Name</strong>-java-11</li><li><strong>JAVA_HOME</strong>= /usr/lib/jvm/java-11-openjdk-11.0.20.0.8–1amzn2.0.1x86_64 (<strong>Java home directory</strong>)</li><li>De-select the “<strong><em>install automatically</em></strong>” option. We already have Java installed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sFANRlQXsmcWehOSWwywuA.png" /></figure><ul><li>Maven:</li><li><strong>Name</strong>= maven- 3.6.3</li><li><strong>MAVEN_HOME</strong>= /opt/maven</li><li>De-select the “i<strong><em>nstall automatically</em></strong>” option. We already have Maven installed.</li><li>Apply and save</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z1dI3YDroPlHkkmEkBhQ1A.png" /></figure><ul><li><strong>Step 8: Build Stage</strong></li><li>Navigate to the Jenkins dashboard, and select “<strong>create item</strong>”. We are going to test our CI/CD build by setting up our first Maven project.</li><li>Type “FirstMavenProject” in the name box</li><li>Select “<strong><em>Maven project</em></strong>”. Click ok.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XC2A51HPhv-VhljZHykWw.png" /></figure><ul><li><strong>Setup</strong>:</li><li>Enter a description for the project build.</li><li>Select “<strong><em>Git</em></strong>” under the Source Code Management. Copy and paste the following git repo URL into the box:</li><li><a href="https://github.com/Nosa213/hello-world.git">https://github.com/Nosa213/hello-world.git</a></li><li>Under Build “Goal and Options” type “<strong><em>clean install</em></strong>”. This will result in a clean copy of the git repository onto Maven.</li><li>Apply and save</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6brQ3qGISDkmctnwkUF78Q.png" /></figure><ul><li><strong>Let’s OFFICIALLY TEST THE BUILD!</strong></li><li>Select “<strong>Build</strong>” under configure. This build will take a few minutes since there is a lot of data stored in the repo.</li><li>After a few minutes, you will see details of the build.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XQo-spWqFbVCrEIGUJh9nw.png" /></figure><ul><li>Our build status shows we have successfully built our Maven project. Let’s go and verify!</li><li>There is a new folder called “<strong><em>Workspace</em></strong>” containing the contents of the Maven project. Locate it and inspect the files. The files should be the exact copy of the git repo we cloned.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vrnguNnJMtiNRtsrVBjlqA.png" /></figure><p>Verify via CLI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ax_9lblCxCyMR_GTqxepHg.png" /></figure><p><strong>Congratulations if you made it to this point that means you have successfully completed this project. In this project, we installed Jenkins onto an AWS EC2 instance, installed git and Maven as well, and integrated them with the Jenkins server to set up a CI/CD pipeline!</strong></p><p><strong>Follow/Subscribe to me on:</strong></p><p>➡️My LinkedIn:<a href="https://www.linkedin.com/in/nosaomorogbe/"> https://www.linkedin.com/in/nosaomorogbe/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af4e667a2e9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Kubernetes on Amazon EKS]]></title>
            <link>https://medium.com/@nicholas.omorogbe/setup-kubernetes-on-amazon-eks-7df3c0b488a1?source=rss-14ff37258537------2</link>
            <guid isPermaLink="false">https://medium.com/p/7df3c0b488a1</guid>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Nicholas Omorogbe]]></dc:creator>
            <pubDate>Fri, 08 Sep 2023 07:14:49 GMT</pubDate>
            <atom:updated>2023-09-08T07:14:49.829Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>You can follow the same procedure in the official AWS documen</strong>t <a href="https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html"><em>Getting started with Amazon EKS — eksctl</em></a></p><h4>Pre-requisites:</h4><ul><li><em>Create an EC2 Instance with the security group on</em> <strong>port 22</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cVijep3GsTSoDf7c.png" /></figure><p><strong><em>Make sure to log in as a root user with the following command</em></strong></p><pre>sudo su -</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c0MO9nm55tUUVKgN.png" /></figure><ul><li><strong>Install AWSCLI&#39;s latest version</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ks0xkYR94x66-EVW.png" /></figure><p><strong><em>You should be able to see the latest version</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TwnyCVldWyuqb_k-.png" /></figure><p><strong>Setup Kubectl</strong><br><strong><em>a. Download Kubectl version 1.21<br>b. Grant execution permissions to Kubectl executable<br>c. Move kubectl onto /usr/local/bin<br>d. Test that your Kubectl installation was successful</em></strong></p><pre>curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/kubectl<br>chmod +x ./kubectl<br>mv ./kubectl /usr/local/bin <br>kubectl version --short --client</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1imt0QYbG2zrdr0D.png" /></figure><p><strong>Setup eksctl</strong><br><strong><em>a. Download and extract the latest release<br>b. Move the extracted binary to /usr/local/bin<br>c. Test that your eksclt installation was successful</em></strong></p><pre>curl --silent --location &quot;https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz&quot; | tar xz -C /tmp<br>sudo mv /tmp/eksctl /usr/local/bin<br>eksctl version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J9Bz78LYyBGvzZza.png" /></figure><ol><li><strong>Create an IAM Role and attach it to the EC2 instance. The IAM user should have access to</strong></li><li><strong>IAM</strong></li><li><strong>EC2</strong></li><li><strong>CloudFormation</strong></li><li><strong>AdministratorAccess (Do not grant this access in the real world)</strong></li></ol><p><strong>Note: Check eksctl documentation for </strong><a href="https://eksctl.io/usage/minimum-iam-policies/"><strong>Minimum IAM policies</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FLkM9JuypkjELPAx.png" /></figure><p><strong><em>Attach the IAM role to your EC2 bootstrap</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*35uysziSldeLEpNP.png" /></figure><p><strong><em>Add the IAM role and update</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nbELtrohU1C3v9tL.png" /></figure><p><strong>Create your cluster and nodes using the command below.</strong></p><pre>eksctl create cluster --name nicholas213  \<br>region ap-northeast-1 \<br>node-type t2.small \</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j7t8eM47Lzo4N0t5.png" /></figure><p><strong>Two new ec2 t2-micro instances have also been created:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yLdBG3aRvHE93aei.png" /></figure><p><strong><em>Validate your cluster using by creating by checking nodes and by creating a pod</em></strong></p><pre>kubectl get nodes<br>kubectl get all<br>kubectl run nickwebapp --image=httpd</pre><p>We have two nodes running when I execute kubectl get nodes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LwCcx3Y9dfYCHeVh.png" /></figure><p><strong><em>We can see all the services running by executing kubectl get all</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*89ZjG3dnr2I69upi.png" /></figure><h4>Deploying Nginx pods on Kubernetes</h4><p>Deploying Nginx Container</p><pre>kubectl create deployment  demo-nginx --image=nginx --replicas=2 --port=80<br>kubectl get all<br>kubectl get pod</pre><p>We have two pods running in our cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*-pUCY3AujN5W2-8L.png" /></figure><p><strong><em>We can check how many replica set it has created kubectl get replicaset</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/0*dmX_ARU_zBFg69PX.png" /></figure><p><em>Expose the deployment as a service. This will create an ELB in front of those 2 containers and allow us to publicly access them</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LqMCOXSAyK-KICDQ.png" /></figure><p><strong>We can verify from the AWS cloud to check the load balancer it has created.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J_D43j3hPhuCNIjd.png" /></figure><h3>Copy the DNS name of the LoadBalancer and paste it on a different tab</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZQK4SD34nnEwGkP0.png" /></figure><h3>You should be able to see Nginx default page</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O9R549YpsCupBSg6.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7df3c0b488a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a simple website on AWS]]></title>
            <link>https://medium.com/@nicholas.omorogbe/how-to-build-a-simple-website-on-aws-41012d458c66?source=rss-14ff37258537------2</link>
            <guid isPermaLink="false">https://medium.com/p/41012d458c66</guid>
            <category><![CDATA[s3-bucket]]></category>
            <category><![CDATA[static-websites]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Nicholas Omorogbe]]></dc:creator>
            <pubDate>Fri, 08 Sep 2023 06:35:05 GMT</pubDate>
            <atom:updated>2023-09-08T06:35:05.247Z</atom:updated>
            <content:encoded><![CDATA[<p>1. <strong><em>We need to create a bucket to host our website</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dXFrR82qifQex2XO.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y86W1_vJix6fm3Vi.png" /></figure><p><strong><em>We have a bucket created.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e9opYXbshJPsZh4Z.png" /></figure><p><strong><em>Click on the bucket to upload your HTML photo, add and upload files</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1D4HrAnXIbGDKEnL.png" /></figure><p><strong><em>We have two uploaded pictures in our bucket</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vFANXVkbJVrnOFW-.png" /></figure><p><strong><em>Next, click on the Destination link</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-k93ySRgBg7mPrsC.png" /></figure><p><strong><em>Click on Upload</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p8sL8GaNKjS4RR96.png" /></figure><p><strong><em>Click on one of the pictures you have uploaded. Copy and paste the URL to check if you can access the site.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x_Z4yThzhw18nMuZ.png" /></figure><p><strong><em>Unfortunately, we could not access the site. We need to change some settings.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rdz7JoMJJ_cBr76Q.png" /></figure><p>Go to properties, scroll down to, Static Website hosting, click on edit, and enable Static Website hosting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*WYUFmFfJPmLRQE2q.png" /></figure><p><strong><em>Make our bucket publicly accessible</em></strong></p><p><em>Click on permissions and edit</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ciJEYnAVnA13MjJB.png" /></figure><p><strong><em>Uncheck the box and Save the changes.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0qkoQeJBTKq20RBc.png" /></figure><p><strong><em>Next, we need to make all objects in our bucket publicly accessible</em></strong></p><p><strong><em>First, click on permissions, scroll down click on object ownership, and enable ACL</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8hkXhLOuQ-T5Pkzw.png" /></figure><p><strong><em>Second, go back and select objects in the bucket, click on Actions scroll down, and select Make Public using ACL</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RHkGT49KKZiHKSVT.png" /></figure><p><strong><em>Click on Make public.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*As_9J8lcvoSXVN3N.png" /></figure><p><strong><em>Finally, refresh the link.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hNAV8HyuBlXPiKIN.png" /></figure><p><strong><em>Second static webpage</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*At7ZykmpIedXAlvL.png" /></figure><p><strong>Congratulations</strong> <em>you were able to create a static website.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41012d458c66" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>