0% found this document useful (0 votes)
5 views2 pages

One-Click Jenkins Pipeline Deployment

The document outlines a final DevOps project to create a one-click Jenkins pipeline for automated deployment using Docker, Terraform, Ansible, and Azure. The pipeline provisions a VM on Azure, installs a web server, and deploys a static web app, all managed through a Jenkins pipeline. It includes a project structure, necessary commands for running Jenkins in Docker, and evaluation criteria for the project components.
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)
5 views2 pages

One-Click Jenkins Pipeline Deployment

The document outlines a final DevOps project to create a one-click Jenkins pipeline for automated deployment using Docker, Terraform, Ansible, and Azure. The pipeline provisions a VM on Azure, installs a web server, and deploys a static web app, all managed through a Jenkins pipeline. It includes a project structure, necessary commands for running Jenkins in Docker, and evaluation criteria for the project components.
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

Final DevOps Project: One-Click Jenkins Pipeline

Deployment
Objective
Build a fully automated DevOps pipeline using Jenkins (in Docker) that:
1. Provisions a VM on Azure using Terraform
2. Installs a web server on that VM using Ansible
3. Deploys a static web app to that server via Ansible
4. Runs all these steps from a single Jenkins pipeline

Technology Stack
Tool Purpose

Docker Host Jenkins in a container (no Compose)

Jenkins Automate the workflow

Terraform Provision the virtual machine

Ansible Configure the VM and deploy the web app

Azure Host the virtual machine

Git Store Jenkinsfile, code, playbooks,


Terraform code

Project Structure

project/
├── terraform/
│ ├── [Link]
│ └── [Link]
├── ansible/
│ ├── install_web.yml
├── app/
│ └── [Link]
├── Jenkinsfile
└── [Link]

Jenkins in Docker

Run Jenkins (with Docker and required tools accessible inside):


docker run -d \
--name jenkins \
-p 8080:8080 -p 50000:50000 \
-v jenkins_home:/var/jenkins_home \
-v /var/run/[Link]:/var/run/[Link] \
-v $(which terraform):/usr/local/bin/terraform \
-v $(which ansible-playbook):/usr/local/bin/ansible-playbook \
-v $(pwd):/workspace \
jenkins/jenkins:lts

Post-install steps inside Jenkins:


- Install plugins: Git, Pipeline, SSH Agent
- Add credentials for SSH private key (used by Ansible)

Terraform on Azure
Terraform code provisions an Ubuntu VM on Azure. Files include `[Link]`, `[Link]`, and optional
`[Link]`.

Ansible Configuration
Installs Apache on the VM and deploys `[Link]` to `/var/www/html/`. Uses a dynamic inventory generated
from Terraform output.

Jenkinsfile Pipeline
Executes Terraform and Ansible in sequential stages, verifies deployment via curl.

Evaluation Criteria
Task Points

Jenkins runs from Docker 2

Terraform script creates VM 4

Ansible installs and configures web server 4

Static site deployed correctly 4

Jenkins pipeline triggers and completes all stages 4

Clean repo & documentation 2

You might also like