Challenge - 5 Problems
Flask CI/CD Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of a GitHub Actions workflow step for Flask testing
Given this GitHub Actions step that runs Flask tests, what is the output if all tests pass?
- name: Run tests
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pytest tests/Attempts:
2 left
💡 Hint
Think about what happens when pytest runs and all tests pass.
✗ Incorrect
If all tests pass, pytest outputs a success message and exits with code 0, so the step completes successfully.
❓ Configuration
intermediate2:00remaining
Correct Dockerfile for a Flask app in CI/CD
Which Dockerfile configuration correctly builds a Flask app image for deployment in a CI/CD pipeline?
Attempts:
2 left
💡 Hint
Flask apps need to listen on all interfaces in containers.
✗ Incorrect
Option D sets the working directory, copies files, installs dependencies, and runs Flask on 0.0.0.0 so it is accessible outside the container.
🔀 Workflow
advanced2:00remaining
Order of steps in a CI/CD pipeline for Flask
Arrange these steps in the correct order for a typical CI/CD pipeline for a Flask app:
Attempts:
2 left
💡 Hint
Tests must pass before building and pushing images.
✗ Incorrect
First run tests to verify code, then build the Docker image, push it to a registry, and finally deploy it.
❓ Troubleshoot
advanced2:00remaining
Error when deploying Flask app: "Address already in use"
You deployed your Flask app in a container but get the error: "OSError: [Errno 98] Address already in use". What is the most likely cause?
Attempts:
2 left
💡 Hint
This error usually means the port is busy.
✗ Incorrect
The error means the port Flask tries to use is already occupied, often by another app or container.
✅ Best Practice
expert2:00remaining
Best practice for secret management in CI/CD for Flask
What is the best practice to handle sensitive environment variables like API keys in a CI/CD pipeline for a Flask app?
Attempts:
2 left
💡 Hint
Think about security and avoiding exposure of secrets.
✗ Incorrect
Storing secrets in environment variables managed by the CI/CD system keeps them out of source code and logs.