Day 28 Task: Jenkins Agents:

Day 28 Task: Jenkins Agents:

Introduction:

Jenkins is a popular open-source automation server that is widely used for building, testing, and deploying software. Docker is a platform that allows you to package an application and its dependencies into a single container, making it easy to deploy and run anywhere. In this tutorial, we will show you how to set up a Jenkins pipeline to build and deploy a Docker container.

Prerequisites:

Before we begin, you should have the following:

  • A Jenkins master instance

  • A Jenkins node with Docker installed

  • A Dockerfile that defines the container image

  • A Git repository that contains the source code of the application

Step-1 Launch two Instances one will be Master and the Other will be Node.

How to Deploy Jenkins Agent and Connect it to Jenkins Master in ...

As you can see on the left side we have our master server and on another side, we have our Node server.

Step-2 Install Jenkins on Master Node and other dependencies on Node as per requirements.

  1. Install Java on Master and Node

  2. Install Jenkins on Master Server

  3. Install Docker on Node Server as per project Requirement.

Step-3 Setup Node Server.

Choose Setup agent.

The host IP will be the Public ip of Node-1.

Add Credentials.

No Need to Install Jenkins on Node Server

adds the user "Jenkins" to the "docker" group on a Master Server only

Step-4 Create and Pipeline and Try to turn it on Node Server.

Jenkins Pipeline – QAutomation

Verify this on Node Server