0
0
Djangoframework~30 mins

CI/CD pipeline basics in Django - Mini Project: Build & Apply

Choose your learning style9 modes available
CI/CD Pipeline Basics with Django
📖 Scenario: You are working on a Django web application. To make your development faster and safer, you want to set up a simple CI/CD pipeline. This pipeline will automatically check your code and deploy it when you push changes.
🎯 Goal: Build a basic CI/CD pipeline configuration file that runs tests and deploys your Django app automatically.
📋 What You'll Learn
Create a YAML file named ci-cd-pipeline.yml for the pipeline configuration
Add a job to install dependencies using pip install -r requirements.txt
Add a job to run Django tests using python manage.py test
Add a job to deploy the app by printing Deploying Django app...
Use job dependencies so tests run after install, and deploy runs after tests
💡 Why This Matters
🌍 Real World
CI/CD pipelines are used in real projects to automatically test and deploy code changes, saving time and reducing errors.
💼 Career
Understanding CI/CD pipelines is essential for DevOps roles and software developers to deliver software quickly and reliably.
Progress0 / 4 steps
1
Create the initial pipeline file
Create a file named ci-cd-pipeline.yml and add a job called install that runs the command pip install -r requirements.txt.
Django
Need a hint?

YAML files use indentation. Make sure script is indented under install, and the command is under script.

2
Add the test job
Add a job called test that runs python manage.py test. Make sure it depends on the install job.
Django
Need a hint?

Use needs to specify that test runs after install.

3
Add the deploy job
Add a job called deploy that prints Deploying Django app.... Make sure it depends on the test job.
Django
Need a hint?

Use echo to print the deploy message in the script.

4
Print the pipeline jobs summary
Print the names of the jobs in order: install, test, and deploy separated by commas.
Django
Need a hint?

Use print to show the job names separated by commas.