Deploying a Django To-do App Using Jenkins Freestyle Project

I am a software engineer with a foundation in software development and expertise in a suite of powerful tools including Docker, Kubernetes, Terraform, Ansible, Helm, Grafana, Prometheus, and Python.
Being AWS Certified further solidifies my proficiency in AWS services and cloud architecture. I am on a mission to master the principles of DevOps. My experience in crafting efficient and robust software solutions, combined with AWS certification, equips me with the skills to optimize processes and enhance system performance.
Let's build a better future through innovation and continuous improvement!
In the thrilling realm of DevOps, automation is the hero we all need to streamline our development and deployment adventures. Today, we embark on a quest to automate the deployment of a Docker container, using the epic Django-based Todo application as our quest item, with Jenkins Freestyle Project as our trusty sidekick. 🌐🐍🕹️
Prerequisites🛠️
Docker installed on your machine.
An AWS EC2 instance configured with Docker and your Django Todo application (as outlined in this project).
Project Overview📝
In our previous escapade, we manually set up and deployed a Django Todo application within a Docker container on an AWS EC2 instance.
We will now automate this process using Jenkins Freestyle Project. 🔄
Step 1: Create a Jenkins Agent for Your App 🕵️♂️
Open Jenkins and navigate to "Manage Jenkins" > "Manage Nodes and Clouds."
Click "New Node" to create a new agent. Provide a name and configure necessary settings.

Step 2: Configure a Freestyle Project ⚙️
Click on "New Item" on the Jenkins dashboard.
Enter a project name and choose "Freestyle project."
Under the "General" section, check "Restrict where this project can be run" and select your created agent.
Step 3: Add Build Steps 🚧
In the project configuration, navigate to the "Build" section.
Click on "Add build step" and choose "Execute shell" (for Unix-based systems) or "Execute Windows batch command" (for Windows).
Enter the following commands:
docker build -t todo-app .to forge your Docker image.docker run -d -p 8001:8001 todo-appto summon your Docker container.

Step 4: Save and Build 💾
Save your project configuration.
Trigger a build by clicking "Build Now" on the project dashboard.

Jenkins, our loyal companion, will now execute the specified build steps, automating the creation of your Docker image and the deployment of your Todo application.
Step 5: Manual Browser Testing 🌐👩💻
Open your preferred web browser.
Navigate to http://localhost:8080 to access your Todo App manually.

Conclusion🎉
In this tutorial, we automated the deployment of a Docker container for our Django Todo application using Jenkins Freestyle Project. This streamlined approach enhances efficiency and ensures consistency in your deployment process. Remember, this automation is built upon the manual setup explained in Project 1.
Feel the power of automation, adapt this tutorial to fit your specific project needs, and share your automated Docker deployment success with Jenkins! 🤖✨




