This repository contains a simple CI/CD pipeline implemented using Jenkins. The pipeline is designed to automatically deploy a static HTML/CSS file to a Docker container and host it on port 8085.
Before setting up and running the CI/CD pipeline, make sure you have the following prerequisites installed:
- Jenkins: Install and configure Jenkins on your local machine or server.
- Docker: Install Docker to run the containerized deployment environment.
- GitHub account: Create a GitHub account to store your static HTML/CSS file.
To set up the CI/CD pipeline, follow these steps:
- Fork this repository: Click the "Fork" button at the top-right corner of this repository to create a copy in your GitHub account.
- Clone the forked repository: Clone the forked repository to your local machine using the
git clonecommand. - Update the HTML/CSS file: Replace the existing static HTML/CSS file (
index.htmlandstyles.css) with your own content. - Push changes to GitHub: Commit and push the updated file to the repository on GitHub.
- Configure Jenkins: Set up a Jenkins job to build and deploy the HTML/CSS file.
- Create a new Jenkins job and configure it as a pipeline.
- Specify the GitHub repository URL and credentials.
- Configure the Jenkins job to trigger on each push to the repository.
- Run the Jenkins job: Start the Jenkins job and observe the pipeline's progress in the Jenkins dashboard.
- Access the deployed application: Once the deployment is successful, access the hosted application in your browser at
http://localhost:8085.
The CI/CD pipeline follows this workflow:
- Jenkins receives a webhook notification on each push to the GitHub repository.
- Jenkins triggers the pipeline job based on the build steps
- The pipeline job:
- Checks out the latest changes from the GitHub repository.
- Builds a Docker image with the static HTML/CSS files.
- Runs a Docker container based on the created image, exposing port 8085.
- The application is now accessible on
http://localhost:8085.
You can customize this pipeline according to your needs:
- Modify the Dockerfile: If you require additional dependencies or customizations for your application, update the Dockerfile accordingly.
- Adjust Jenkins job triggers: Instead of triggering the pipeline on each push, you can configure Jenkins to trigger the job based on specific branches or tags.
- Change the port number: If you prefer a different port for hosting the application, update the Dockerfile and Jenkins pipeline accordingly.
If you encounter any issues or have suggestions for improvement, feel free to open an issue or submit a pull request. Contributions are always welcome!
This project is licensed under the MIT License.
