Project Overview
This project involved hosting an eCommerce website on an AWS EC2 instance and automating its deployment using Jenkins, Git, and Apache Httpd. Below are the detailed steps I followed to complete this project:
Steps Followed
- Launch EC2 Instance:
Created an AWS EC2 instance and opened ports for SSH and HTTP traffic in the security group. Installed Jenkins on the instance and configured it for the pipeline.
- Set Up Jenkins:
Installed necessary plugins in Jenkins, including Git integration, and modified permissions to allow Jenkins to execute commands.
- Create a Pipeline Project:
Configured a new pipeline project in Jenkins to automate the deployment tasks.
- Write the Pipeline Script:
Added a script with multiple stages to automate tasks like cloning the Git repository, verifying the workspace, installing Apache Httpd, and copying files to the web directory.
- Host the Website:
Started the Apache Httpd service, copied the website files to the appropriate directory, and verified the website on the public IP of the EC2 instance.
- Automate Deployment:
Enabled GitHub Webhooks and configured Jenkins to trigger new builds automatically whenever changes were pushed to the GitHub repository.
Outcome
The eCommerce website was successfully hosted on an EC2 instance and integrated with a CI/CD pipeline to automate deployments. This setup ensures that any updates to the code are automatically reflected in production.