Skip to content

gowda-m/jenkins-ci-cd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins CI/CD Pipeline – Apache Static Website Deployment


Project Overview

This project demonstrates a complete CI/CD pipeline implemented on a local machine using Jenkins to automate deployment of a static website to an Apache web server.

The pipeline pulls code from a GitHub repository and deploys the website to Apache’s document root directory, making it accessible via a browser.


Technologies Used

  • Jenkins (CI/CD Automation)
  • Apache HTTP Server
  • Git & GitHub
  • Linux (SLES / Local System)

Step-by-Step Implementation


Step 1: Install and Start Apache Server

sudo zypper install apache2 -y
sudo systemctl start apache2
sudo systemctl enable apache2

apache_install

Verification:

http://localhost

apache_ui.png


Step 2: Install Git in Both servers

Git is required for Jenkins to pull code from GitHub.

sudo zypper install git -y

Verify:

git --version

git_install


Step 3: Install and Setup Jenkins

sudo zypper install jenkins -y
sudo systemctl start jenkins
sudo systemctl enable jenkins

jenkins_install

Access Jenkins:

http://localhost:8080

Initial Setup:

  • Enter admin password
  • Install suggested plugins

jenkins_UI


Step 4: Add Jenkins Credentials

  • Go to Manage Jenkins → Credentials
  • Add SSH / Git credentials
  • Use credentials in pipeline

credentials_add.png


Step 5: Configure SSH Access (Local Deployment)

ssh-keygen -t rsa
ssh-copy-id root@localhost

Test:

ssh root@localhost

SSH_Setup


Step 6: Add Jenkins Node (Agent Configuration)

  • Go to Manage Jenkins → Nodes
  • Click New Node
  • Configure node details
  • Connect node to Jenkins master

Node_online


Step 7: Create Jenkins Pipeline Job

  • Click New Item
  • Select Pipeline
  • Configure job

Branch_created1


Step 8: Configure GitHub Repository

  • Add repository URL
  • Select branch (main/master)
  • Configure webhook for auto trigger

webhook


Step 9: Configure Pipeline

  • Select Pipeline script from SCM
  • SCM: Git
  • Script Path: Jenkinsfile

configuration


Step 10: Push Code to GitHub using VS Code

  • git add .
  • git commit -m "Initial commit"
  • git push -u origin main

push_code


Step 11: Trigger Build and Verify Console Output

  • auto Build Now
  • Check logs for success

auto_deploy_console.png


Step 12: Verify Deployment

Files deployed to:

/var/www/html/

Step 13: Verify Website

http://localhost

Website is live

deployment


CI/CD Workflow

  1. Code pushed to GitHub
  2. Webhook triggers Jenkins
  3. Jenkins pulls code
  4. Pipeline executes
  5. Deployment to Apache
  6. Website goes live

Final Result

  • CI/CD pipeline successfully implemented
  • Automated deployment achieved
  • Website deployed on Apache

Notes

  • Local environment setup
  • Can extend to AWS / Production

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages