<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Saeed H</title>
    <description>The latest articles on DEV Community by Saeed H (@shersi32).</description>
    <link>https://dev.to/shersi32</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1080390%2Fcdde1e93-5a83-443f-83a5-02d6473956dc.png</url>
      <title>DEV Community: Saeed H</title>
      <link>https://dev.to/shersi32</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shersi32"/>
    <language>en</language>
    <item>
      <title>How to Deploy a Containerized App on AWS Using Jenkins</title>
      <dc:creator>Saeed H</dc:creator>
      <pubDate>Mon, 21 Aug 2023 17:56:32 +0000</pubDate>
      <link>https://dev.to/shersi32/how-deploy-a-containerized-app-on-aws-using-jenkins-3eje</link>
      <guid>https://dev.to/shersi32/how-deploy-a-containerized-app-on-aws-using-jenkins-3eje</guid>
      <description>&lt;p&gt;In this project we are going to build on the multi-branch pipeline we set up in the previous project( see here &lt;a href="https://shorturl.at/cuCJL"&gt;https://shorturl.at/cuCJL&lt;/a&gt;). So the main focus for this article will be the deployment stage. Our objective is to connect to a remote server (EC2 Server) via from Jenkins using a SSH Agent and execute docker commands to create a container that runs an application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS account with EC2 instance.&lt;/li&gt;
&lt;li&gt;Docker Hub account with Docker image.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Server 1: Jenkins Setup&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch an EC2 instance for Jenkins (Server 1).
we have already set up a Jenkins server in the previous tutorial. See the link above.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Server 2: EC2 Instance Setup&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch another EC2 instance for your application (Server 2) Create a new key pair and store it in a secure and accessible location on your computer. I have chosen &lt;em&gt;.pem&lt;/em&gt; format as I am using Linux.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6IYIUmPm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9d0xvhq27oke0n6wx00k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6IYIUmPm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9d0xvhq27oke0n6wx00k.png" alt="Image description" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SSH into the server using the private key and install Docker:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   sudo yum update
   sudo yum install docker.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Start Docker service:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   sudo systemctl start docker
   sudo systemctl enable docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add ec2-user to docker group to be able to execute commands:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   sudo usermod -aG docker $USER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Log out and log back for it to take effect.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login to docker&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Jenkins Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install SSH Agent plugin. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xy0xrpkS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3mfc4dwqdww8cmlqxoz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xy0xrpkS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i3mfc4dwqdww8cmlqxoz.png" alt="Image description" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure SSH agent in Jenkins:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Inside credentials  for multi-branch&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to "Manage Jenkins" &amp;gt; "Manage Credentials" &amp;gt; "Global credentials" &amp;gt; "Add Credentials".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose "SSH Username with private key".&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l9wy3tmk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbtxcvld4q0gz9md6719.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l9wy3tmk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbtxcvld4q0gz9md6719.png" alt="Image description" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Give it an ID, enter the username (&lt;code&gt;ec2-user&lt;/code&gt;), paste the private key downloaded earlier (for server 2).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5QGRfgFR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1lbirix57u1pszq510q5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5QGRfgFR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1lbirix57u1pszq510q5.png" alt="Image description" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add SSH Agent credentials to the Jenkins file:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Jenkins has a cool feature that will generate the syntax needed for any plugin. Inside the Multi-branch pipeline go to 'Pipeline Syntax'&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F-M_408p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rc0xkgp6kt67n0vymroe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F-M_408p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rc0xkgp6kt67n0vymroe.png" alt="Image description" width="462" height="814"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the 'sshagent: SSH Agent', choose 'ec2-user' and generate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xTfBqA31--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2n5t43p27palllyaqvq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xTfBqA31--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2n5t43p27palllyaqvq.png" alt="Image description" width="635" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, lets paste the generated syntax in to our Jenkins file and add our logic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stage("deploy") {

            steps {
                script {
                    echo 'Deploying docker image to EC2'
                    def dockerCmd = "docker run -p 8080:8080 -d shersi32/myapp:1"
                sshagent(['ec2-server']) {
                  sh "ssh -o StrictHostKeyChecking=no ec2-user@54.175.82.44 ${dockerCmd}"
                    }
                }
            }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few points about out the Jenkins file:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We created a variable for the docker run command to make things easier.&lt;/li&gt;
&lt;li&gt;The "-o StrictHostKeyChecking=no" command suppresses pop ups (basically questions that may prevent the commands from executing)&lt;/li&gt;
&lt;li&gt;Finally, there is no need for 'docker login' since we have logged in already (see above)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Save the Jenkins file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure the Firewall on Server 2 (EC2)&lt;/strong&gt;&lt;br&gt;
Add an inbound rule for server 2 to allow SSH access from the Jenkins server. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IR-8Q9vY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jibi1c6tx52gpbrl1jbk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IR-8Q9vY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jibi1c6tx52gpbrl1jbk.png" alt="Image description" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now lets see it in action&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Commit your code changes to the Git repository.&lt;/li&gt;
&lt;li&gt;Trigger the Jenkins pipeline manually &lt;/li&gt;
&lt;li&gt;Jenkins will build your Docker image, push it to Docker Hub.&lt;/li&gt;
&lt;li&gt;Then for the deploy stage, Jenkins will SSH in to the EC2 Server, pull the image from Docker Hub and start the container. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the stage view of the pipeline:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7FowXrSd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5yu9fe9tgat0my29a7mn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7FowXrSd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5yu9fe9tgat0my29a7mn.png" alt="Image description" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the logs for the 'deploy' stage:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S9t2_njq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbkedt5y5gx4t9y6c31m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S9t2_njq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vbkedt5y5gx4t9y6c31m.png" alt="Image description" width="800" height="647"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now lets check out the EC2 server:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vj0myyx4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdya2hl4x0eq9zep0ads.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vj0myyx4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdya2hl4x0eq9zep0ads.png" alt="Image description" width="800" height="71"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And we did it! There is the container up and running!&lt;/p&gt;

&lt;p&gt;All that's left now is to access our application using a browser. we just need the the public IP address and the port. &lt;br&gt;
So, for us it is 54.175.82.44:3080. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qMyhOhxS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmms2x0a81s4bbrq0pa8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qMyhOhxS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmms2x0a81s4bbrq0pa8.png" alt="Image description" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And there it is, Brilliant!&lt;/p&gt;

&lt;p&gt;So, That's all from me for now. I hope this blog is useful!&lt;/p&gt;

&lt;p&gt;_Feel free to contact me with any feedback/questions/suggestions. _&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to set-up a Multi-Branch Pipeline on Jenkins</title>
      <dc:creator>Saeed H</dc:creator>
      <pubDate>Sun, 13 Aug 2023 11:45:29 +0000</pubDate>
      <link>https://dev.to/shersi32/multi-branch-pipeline-on-jenkins-4ccc</link>
      <guid>https://dev.to/shersi32/multi-branch-pipeline-on-jenkins-4ccc</guid>
      <description>&lt;p&gt;A multi-branch pipeline is a concept that automatically sets up Jenkins pipelines based on Git branches. It discovers new branches in GitHub (or any other SCM) and creates a pipeline for that branch. Once a new pipeline is set up, Jenkins uses the Jenkins file in that branch for build stages.&lt;/p&gt;

&lt;p&gt;In this article we'll be going through the steps to set up a multi-branch pipeline for a basic Java/Maven App.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install and Configure Jenkins&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you haven't already, install Jenkins on your server or local machine following the official installation guide: &lt;a href="https://www.jenkins.io/doc/book/installing/" rel="noopener noreferrer"&gt;https://www.jenkins.io/doc/book/installing/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After installation, open Jenkins in your web browser (&lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt; by default).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Install Required Plugins&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on "Manage Jenkins" in the left sidebar.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9309fl10w38b259p76a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu9309fl10w38b259p76a.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select "Manage Plugins."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluf9ui4kzbk2ixa9u3d9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluf9ui4kzbk2ixa9u3d9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the "Available" tab.&lt;/li&gt;
&lt;li&gt;Search for and install the following plugins if they're not already installed:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Integration&lt;/strong&gt;: Allows Jenkins to interact with GitHub repositories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline Maven Integration&lt;/strong&gt;: Allows Jenkins to work with Maven projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Create a New Multi-Branch Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on "New Item" in the left sidebar.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qjrsamgp38j24n19ttp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qjrsamgp38j24n19ttp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enter a name for your pipeline (e.g., "Multi-Branch Pipeline").&lt;/li&gt;
&lt;li&gt;Choose "Multibranch Pipeline" as the project type and click "OK."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0rgwd245e6mk8f8rly7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn0rgwd245e6mk8f8rly7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Configure Source Code Management&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the "Branch Sources" section, click "Add Source" and select "GitHub."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyzvdoc877xz7a4wq3eqj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyzvdoc877xz7a4wq3eqj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on "GitHub" to configure the source details.&lt;/li&gt;
&lt;li&gt;Provide your GitHub credentials or a personal access token (recommended for security).&lt;/li&gt;
&lt;li&gt;Select the GitHub repository where your Java Maven project is hosted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpb60aw8arx6ka4aa6nre.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpb60aw8arx6ka4aa6nre.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Specify the behavior for discovering branches. You can click on 'add' then choose 'filter by name(with regular expression'. In this case, we will choose the wildcard option to discover branches from the repo. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bvjh28983agv6t74qfo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bvjh28983agv6t74qfo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs683apk5jxou8miwzyuq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs683apk5jxou8miwzyuq.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click "Save" to save the configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Configure Jenkinsfile&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In your GitHub repository, create a file named "Jenkinsfile" (without quotes) in the root directory. This file defines your pipeline.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbydrfnm2mvb6uhekks8n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbydrfnm2mvb6uhekks8n.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Here's an example Jenkinsfile for a basic Java Maven project:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekv5ovy5yhssvump4rmn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekv5ovy5yhssvump4rmn.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This Jenkinsfile defines three stages: Checkout, Build, and Test. It checks out the code from the repository, builds the Maven project, and runs tests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Run the Multi-Branch Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Back in Jenkins, you should see your multi-branch pipeline project.&lt;/li&gt;
&lt;li&gt;Jenkins will automatically detect branches in your GitHub repository and create pipeline instances for each branch.&lt;/li&gt;
&lt;li&gt;Click on a specific branch to see the pipeline runs and their status.&lt;/li&gt;
&lt;li&gt;To manually trigger a pipeline run, click "Run" on the specific branch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep your Maven project's &lt;code&gt;pom.xml&lt;/code&gt; file in the repository to manage project dependencies and configuration.&lt;/li&gt;
&lt;li&gt;Make sure your Maven project has appropriate unit tests.&lt;/li&gt;
&lt;li&gt;Regularly update Jenkins and its plugins for security and new features.&lt;/li&gt;
&lt;li&gt;Use a version control system (like Git) for your codebase.&lt;/li&gt;
&lt;li&gt;Secure your credentials using Jenkins' credentials plugin and avoid hardcoding sensitive information in your Jenkinsfile.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, there you have it we have set up a multi-branch pipeline for our Java Maven app on Jenkins, which will automatically build and test your project across different branches. Customize the pipeline stages and steps according to your project's needs, and you'll have a powerful and automated CI/CD process in place. &lt;/p&gt;

&lt;p&gt;Stay tuned as we'll take this further in the new future and go a little bit deeper.&lt;/p&gt;

</description>
      <category>jenkins</category>
      <category>cicd</category>
      <category>git</category>
      <category>devops</category>
    </item>
    <item>
      <title># Setting Up and Configuring a Server with a Bash Script</title>
      <dc:creator>Saeed H</dc:creator>
      <pubDate>Wed, 12 Jul 2023 07:17:54 +0000</pubDate>
      <link>https://dev.to/shersi32/-setting-up-and-configuring-a-server-with-a-bash-script-3ldj</link>
      <guid>https://dev.to/shersi32/-setting-up-and-configuring-a-server-with-a-bash-script-3ldj</guid>
      <description>&lt;p&gt;As a beginner, understanding how to set up and configure a server can be quite scary. However, with the help of a simple Bash script, you can automate this process and make it more accessible. In this blog article, we will walk you through the steps to create a Bash script that sets up and configures a server using a YAML configuration file. Let's get cracking! &lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin, make sure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic understanding of the Bash scripting language.&lt;/li&gt;
&lt;li&gt;Access to a terminal or command line interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;To create our script, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open a text editor and create a new file. Let's name it &lt;code&gt;script.sh&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start the script by adding the shebang line, which specifies the interpreter to use:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add a description to the script to help users understand its purpose:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"setup and config server"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Define a variable to hold the name of the configuration file:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;file_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Check if the &lt;code&gt;config&lt;/code&gt; directory exists:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"config"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;
   &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;If the &lt;code&gt;config&lt;/code&gt; directory exists, display a message stating that its contents are being read:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;     &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"reading config directory contents"&lt;/span&gt;
     &lt;span class="nv"&gt;config_files&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;ls &lt;/span&gt;config&lt;span class="si"&gt;)&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;If the &lt;code&gt;config&lt;/code&gt; directory does not exist, display a message stating that it will be created:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;     &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"config dir not found. creating one"&lt;/span&gt;
     &lt;span class="nb"&gt;mkdir &lt;/span&gt;config
   &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Display a message indicating that the &lt;code&gt;config.yaml&lt;/code&gt; file will be used for configuration:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"using file &lt;/span&gt;&lt;span class="nv"&gt;$file_name&lt;/span&gt;&lt;span class="s2"&gt; to config it"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Finally, display a list of all the configuration files found in the &lt;code&gt;config&lt;/code&gt; directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"here are all the config files: &lt;/span&gt;&lt;span class="nv"&gt;$config_files&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! You have created a basic Bash script that sets up and configures a server.&lt;/p&gt;

&lt;p&gt;Next we'll look at how to actually put it in to action!&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the Script
&lt;/h2&gt;

&lt;p&gt;To use the script, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Open a terminal or command line interface.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to the directory where the &lt;code&gt;script.sh&lt;/code&gt; file is located.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make the script executable by running the following command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;chmod&lt;/span&gt; +x script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This part is key! Many beginners over look the importance of permissions. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Execute the script by running the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ./script.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The script will handle the setup and configuration of the server for you. It will check if the &lt;code&gt;config&lt;/code&gt; directory exists and create it if necessary. Then, it will use the &lt;code&gt;config.yaml&lt;/code&gt; file to configure the server. Finally, it will display a list of all the configuration files found in the &lt;code&gt;config&lt;/code&gt; directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So let's recap, we have covered the process of creating a simple Bash script to set up and configure a server. By automating these tasks, you can simplify the server setup process, even as a beginner. Remember to customize the configuration according to your needs, and feel free to enhance the script as you gain more experience.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed reading!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Beginners Guide to Shell Scripts</title>
      <dc:creator>Saeed H</dc:creator>
      <pubDate>Fri, 09 Jun 2023 14:33:28 +0000</pubDate>
      <link>https://dev.to/shersi32/a-beginners-guide-to-shell-scripts-2acn</link>
      <guid>https://dev.to/shersi32/a-beginners-guide-to-shell-scripts-2acn</guid>
      <description>&lt;p&gt;Introduction:&lt;br&gt;
Shell scripting is an essential skill for DevOps engineers, allowing them to automate tasks, streamline processes, and improve efficiency. In this blog post, I'll provide a step-by-step guide for creating effective shell scripts from scratch. Utilizing diagrams, images, and practical examples, you will gain a comprehensive understanding of the shell scripting, enabling you to create powerful automation solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Understanding Shell Scripting:&lt;/strong&gt;&lt;br&gt;
Shell scripting entails writing a sequence of commands in a plain text file, executable by the shell (command-line interpreter). As a DevOps engineer, you will primarily work with the Bash shell, a widely used scripting language. Mastering shell scripting empowers you to automate repetitive tasks and optimize workflows, driving operational efficiency and productivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Setting Up the Environment:&lt;/strong&gt;&lt;br&gt;
To start your journey into shell scripting, make sure you have a Unix-like operating system, such as Linux or macOS. These systems typically come pre-installed with a default shell, such as Bash. You can check the shell environment by using the command &lt;code&gt;echo $SHELL&lt;/code&gt; in your terminal. Also, choose a text editor suited to your preferences and comfort level, such as Vim, Emacs, or Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Developing Your First Shell Script:&lt;/strong&gt;&lt;br&gt;
Let's create a simple yet significant shell script that outputs "Hello, World!" to the terminal. Follow these steps:&lt;/p&gt;

&lt;p&gt;Step 1: Launch your chosen text editor and create a new file. Assign a descriptive name to the file, ensuring it carries the &lt;code&gt;.sh&lt;/code&gt; extension, e.g., &lt;code&gt;hello.sh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Step 2: Begin your script with a shebang line, specifying the interpreter. For Bash scripts, the shebang line is &lt;code&gt;#!/bin/bash&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Step 3: Provide a concise comment that describes the script's purpose and functionality, fostering better understanding and maintainability. For instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# This script prints "Hello, World!" to the terminal.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Proceed to write the script code. In this instance, a single line utilizing the &lt;code&gt;echo&lt;/code&gt; command is sufficient to display the desired message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# This script prints "Hello, World!" to the terminal.&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, World!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Now Let's Execute and Test Your Shell Script:&lt;/strong&gt;&lt;br&gt;
To execute your shell script, follow these steps:&lt;/p&gt;

&lt;p&gt;Step 1: Grant execution permissions to the script by using the command &lt;code&gt;chmod +x hello.sh&lt;/code&gt;. This command allows the script to be executed.&lt;/p&gt;

&lt;p&gt;Step 2: Execute the script by invoking &lt;code&gt;./hello.sh&lt;/code&gt; in your terminal. Observe the output "Hello, World!" &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Let's Take Your Shell Script to The Next Level:&lt;/strong&gt;&lt;br&gt;
Now that you have created your first shell script, let's explore ways to enhance its functionality.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accepting User Input:
To make it more interactive, prompt the user for input within your script. For example, modify the script to request the user's name and personalize the greeting:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# This script prompts the user for their name and prints a personalized greeting.&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"What is your name?"&lt;/span&gt;
&lt;span class="nb"&gt;read &lt;/span&gt;name
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Utilizing Variables:
Leverage variables within your script to store and manipulate data. Enhance the previous script by storing the greeting message in a variable:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# This script prompts the user for their name and prints a personalized greeting.&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"What is your name?"&lt;/span&gt;
&lt;span class="nb"&gt;read &lt;/span&gt;name
g

&lt;span class="nv"&gt;reeting&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;!"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$greeting&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Conditional Statements and Loops:
Shell scripts support conditional statements (if-else) and loops (for, while), allowing for more a sophisticated control flow. Consider the following example, using a loop to greet the user multiple times:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c"&gt;# This script prompts the user for their name and prints a personalized greeting five times.&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"What is your name?"&lt;/span&gt;
&lt;span class="nb"&gt;read &lt;/span&gt;name

&lt;span class="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;1..5&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello, &lt;/span&gt;&lt;span class="nv"&gt;$name&lt;/span&gt;&lt;span class="s2"&gt;! (&lt;/span&gt;&lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="s2"&gt;)"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Conclusion:&lt;/strong&gt;&lt;br&gt;
Congratulations on acquiring the foundational knowledge for creating shell scripts. By starting  with a simple "Hello, World!" script and then exploring techniques for script enhancement, you are now equipped to pursue advanced automation endeavors. Shell scripting empowers DevOps engineers to streamline operations, optimize workflows, and achieve significant productivity gains. Dedicate time to practice, experiment, and exploit the extensive capabilities of shell scripting, furthering your professional growth and proficiency.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>automation</category>
      <category>beginners</category>
      <category>cli</category>
    </item>
    <item>
      <title>Shell Scripting Explained</title>
      <dc:creator>Saeed H</dc:creator>
      <pubDate>Tue, 06 Jun 2023 09:08:36 +0000</pubDate>
      <link>https://dev.to/shersi32/why-shell-scripting-gm3</link>
      <guid>https://dev.to/shersi32/why-shell-scripting-gm3</guid>
      <description>&lt;h2&gt;
  
  
  What is it?
&lt;/h2&gt;

&lt;p&gt;Shell scripting is a powerful tool used in the world of Tech. It allows users to automate tasks and run several commands at once, making it an essential skill for system administrators, DevOps engineers, and software developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;p&gt;One of the main benefits of shell scripting is its ability to simplify complex processes. With shell scripting, users can &lt;em&gt;&lt;strong&gt;automate repetitive tasks&lt;/strong&gt;, &lt;strong&gt;create custom commands&lt;/strong&gt;, &lt;strong&gt;keep history of configurations&lt;/strong&gt;, and even schedule scripts to run at specific times&lt;/em&gt;. This can save time and increase efficiency, especially when working with large amounts of data or complex systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real World Uses
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a_akxqoq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgv67s1199897ycoehi4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a_akxqoq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgv67s1199897ycoehi4.png" alt="Image description" width="246" height="205"&gt;&lt;/a&gt;&lt;br&gt;
In the real world, shell scripting is used in a variety of scenarios. For example, system administrators use shell scripts to manage servers, automate backups, and perform maintenance tasks. DevOps engineers use shell scripting to deploy applications, manage cloud infrastructure, and automate testing. Software developers use shell scripting to build and package applications, manage dependencies, and automate build processes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Finally, shell scripting as you can see is an essential skill for anyone working in the world of Tech. Its ability to automate tasks and simplify complex processes makes it a valuable tool in a variety of real-world scenarios. In the following blogs, we will explore in detail how to write effective shell scripts and explore some common use cases.&lt;/p&gt;

</description>
      <category>shell</category>
      <category>scripts</category>
      <category>linux</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
