Day 24 Task: Complete Jenkins CI/CD Project
🔹Task-01
Fork this repository:
Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.
login into the Jenkins dashboard and click on "create new job" Enter the job/item name and select "freestyle project"
Under Source Code Management, select Git and Added the repository URL (my forked repository).
Enabled GitHub hook trigger for GITScm polling.
GitHub WebHooks and CI/CD Setup:
Accessed my repository on GitHub.
Went to "Settings" > "Webhooks".
Added a new webhook with my Jenkins job's URL Selected events to trigger (e.g., push, pull request).
Saved the webhook.
🔹Task 02:
Running the Application:
Add the current user to the
docker
group:sudo usermod -aG docker $USER sudo reboot
Add the Jenkins user to the
docker
group:sudo usermod -aG docker jenkins sudo systemctl restart jenkins
Within the Jenkins job's "Execute shell" build step, navigated to the project's directory using
cd
.Ran the application using Docker Compose:
docker-compose up -d
.Saved the changes.
do some changes in the project and commit changes.
the pipeline is automatically triggered.
I can access the application in my browser at the defined port (e.g., PublicIP:8000).