Example of Docker based, Python Flask MongoDB application and CI/CD pipeline for integrating it with Semaphore 2.0. This application demonstrates CRUD operations using Flask and MongoDB as database. It also includes UI for all CRUD views.
-
Fork this repository and clone into your local
-
Make sure, you have docker-compose and docker installed on your machine
-
Run following docker-compose command
docker-compose up
-
That's all. Visit localhost:5000 from your browser, You'll see flask application running.
Fork this repository and use it to create a project
curl https://storage.googleapis.com/sem-cli-releases/get.sh | bash
sem connect <semaphore-organization-link> <semaphore-id> // found in Semaphore Dashboard
cd <project directory>
sem init
Install SEM CLI into your local
Create your Docker credential file using metadata name as pyflask-semaphore and encrypt it with SEM CLI tool that is installed in previous step How To
Once everything will setup appropriately as descibed in above steps, The CI pipeline will look like this:
The example pipeline contains 2 blocks:
- Build
- Docker build
- Run Docker Image
- Run latest Docker image