0% found this document useful (0 votes)
27 views5 pages

Dev 5

This document outlines the steps to create a continuous delivery pipeline in Jenkins and deploy it to the cloud. It describes configuring Jenkins, creating a Maven project, writing deployment scripts, setting up the Jenkins pipeline, integrating a cloud provider, and configuring deployment stages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views5 pages

Dev 5

This document outlines the steps to create a continuous delivery pipeline in Jenkins and deploy it to the cloud. It describes configuring Jenkins, creating a Maven project, writing deployment scripts, setting up the Jenkins pipeline, integrating a cloud provider, and configuring deployment stages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

EX.

NO: 5
CREATE A CD PIPELINE IN JENKINS AND DEPLOY IN CLOUD
DATE:

AIM:

To Create a CD Pipeline in Jenkins and deploy in Cloud.

ALGORITHM:

Step 1: Configure Jenkins Server

Step 2: Create a Maven Project

Step 3: Write Deployment Scripts

Step 4: Set Up Jenkins Pipeline

Step 5: Integrate Cloud Provider

Step 6: Configure Deployment Stage

Step7: Monitor and verify

PROCEDURE:
Step 1: Download Jenkins
• Navigate to the Jenkins download page.
• Scroll down to Generic Java package (.war) and click on it to download the file; save it
someplace where you can locate it easily.
• The reason to use the WAR file is that it is a one-time executable file that is easily
executable and removable.

• Download Jenkins as Java WAR file

Step 2: Execute Jenkins as a Java binary


• Open a terminal window and enter the directory where you downloaded Jenkins with cd
<your path>. (Before you proceed, make sure JDK is installed and added to the
environment path.)

KGiSL INSTITUTE OF TECHNOLOGY REG.NO: 711721243012


• Execute the following command, which will run the WAR file as an executable binary:
java -jar ./jenkins.war
• If everything goes smoothly, Jenkins should be up and running at the default port 8080.
• Execute as an executable JAR binary

Step 3: Create a new Jenkins job


• Open a web browser and navigate to localhost:8080. Unless you have a previous Jenkins
installation, it should go straight to the Jenkins dashboard.
• Click Create New Jobs. You can also click New Item on the left. Create New Job

Step 4: Create a pipeline job


• In this step, you can select and define what type of Jenkins job you want to create. Select
Pipeline and give it a name (e.g., TestPipeline). Click OK to create a pipeline job.
• Create New Pipeline Job you will see a Jenkins job configuration page. Scroll down to
find Pipeline section.
• There are two ways to execute a Jenkins pipeline. One way is by directly writing a
pipeline script on Jenkins, and the other way is by retrieving the Jenkins file from SCM
(source control management). We will go through both ways in the next two steps.

KGiSL INSTITUTE OF TECHNOLOGY REG.NO: 711721243012


Step 5: Configure and execute a pipeline job through a direct script
• To execute the pipeline with a direct script, begin by copying the contents of the sample
Jenkinsfile from GitHub.
• Choose Pipeline script as the Destination and paste the Jenkinsfile contents in Script.
Spend a little time studying how the Jenkins file is structured.
• Notice that there are three Stages: Build, Test, and Deploy, which are arbitrary and can
be anything. Inside each Stage, there are Steps; in this example, they just print some
random messages.
• Click Save to keep the changes, and it should automatically take you back to the Job
Overview.Configure to Run as Jenkins Script
• To start the process to build the pipeline, click Build Now. If everything works, you will
see your first pipeline (like the one below).Click Build Now and See Result
• To see the output from the pipeline script build, click any of the Stages and click Log.
You will see a message like this.Visit sample GitHub with Jenkins get clone link

KGiSL INSTITUTE OF TECHNOLOGY REG.NO: 711721243012


Step 6: Configure and execute a pipeline job with SCM
• Now, switch gears: In this step, you will Deploy the same Jenkins job by copying the
Jenkinsfile from a source-controlled GitHub.
• In the same GitHub repository, pick up the repository URL by clicking Clone or
download and copying its URL.Checkout from GitHub
• Click Configure to modify the existing job. Scroll to the Advanced Project Options
setting, but this time, select the Pipeline script from SCM option in the Destination
dropdown.
• Paste the GitHub repo's URL in the Repository URL, and type Jenkinsfile in the Script
Path. Save by clicking the Save button.Change to Pipeline script from SCM
• To build the pipeline, once you are back to the Task Overview page, click Build Now to
execute the job again. The result will be the same as before, except you have one
additional stage called Declaration: Checkout SCM.Build again and verify.
• To see the pipeline's output from the SCM build, click the Stage and view the Log to
check how the source control cloning process went.
• Verify Checkout Procedure.Do more than print messages.You've built your first Jenkins
pipeline.

KGiSL INSTITUTE OF TECHNOLOGY REG.NO: 711721243012


OUTPUT:

RESULT:

Hence, CD pipeline is created in jenkins and deployed in cloud successfully

KGiSL INSTITUTE OF TECHNOLOGY REG.NO: 711721243012

You might also like