- Intro
- CI/CD
- UnitTest
- Depndencies
- [Docker Build](#Docker Build)
- [Running Docker Container](#Running Docker Container)
This is simple flask application based on Python Flask Web framework which utilizes the app routes view functions as endpoints.
- App has three endpoints ,default,/health and /metadata
-
/
- default
-
/health
- would show status_code and message.
-
/metadata
- Would show application metadata,version and github last commit.
-
- Configured Travis as CI/CD Pipeline for each commit on github.
- And also app to be built on python version 2.7 and 3.6.
- For each commit of the 2 parallel builds running for each of the python version.
- Travis pipeline script also builds docker image and runs the docker container .
- Runs unittest cases of the application
- I have used python unittest framework to develop the unit test cases for the above app to test endpoints and its data.
python test.py -v
- I have packaged dependencies in requirement.txt file to install dependencies using pip before the app would executed.
- Containerized the flask app into single deployable artifact and its dependencies.
docker build -t flaskapp:latest .
- The below command would run the docker container which contains flask web application and runs on port 80.
docker run -d -p 80:80 flaskapp
- Once you have executed ,see the running container using below.
docker ps -a
- There is a delay in loading when we browse /health endpoint,becasue of the app is trying to point its own url and returing the status code . It tries to contact itself to find out the status of the app.