0
0
Flaskframework~10 mins

CI/CD pipeline for Flask - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the Flask app instance.

Flask
from flask import Flask
app = Flask([1])
Drag options to blanks, or click blank then click option'
A"__name__"
B"app"
C"__main__"
D"flask"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like 'app' instead of __name__ causes Flask to not find resources correctly.
2fill in blank
medium

Complete the GitHub Actions workflow trigger to run on push to the main branch.

Flask
on:
  push:
    branches:
      - [1]
Drag options to blanks, or click blank then click option'
Arelease
Bdevelop
Cfeature
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'develop' or feature branches triggers workflows too often or on the wrong branch.
3fill in blank
hard

Fix the error in the Dockerfile command to install dependencies from requirements.txt.

Flask
RUN pip install [1] requirements.txt
Drag options to blanks, or click blank then click option'
A--require
B-R
C-r
D--install
Attempts:
3 left
💡 Hint
Common Mistakes
Using uppercase or incorrect options causes pip to fail installing dependencies.
4fill in blank
hard

Fill all three blanks to create a GitHub Actions job step that runs tests using pytest.

Flask
- name: Run tests
  run: [1] [2] [3]
Drag options to blanks, or click blank then click option'
Apytest
Bpython
C-m
Dtest
Attempts:
3 left
💡 Hint
Common Mistakes
Running 'pytest' directly may fail if not installed globally or in PATH.
5fill in blank
hard

Fill all three blanks to define a Dockerfile entrypoint that runs the Flask app.

Flask
ENTRYPOINT ["[1]", "-m", "[2]", "[3]"]
Drag options to blanks, or click blank then click option'
Apython
Bflask
Capp
Drun
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'app' instead of 'flask' or missing the 'run' command causes the container to not start the server.