|
| 1 | +# Devops example application |
| 2 | + |
| 3 | +This application serves as an example to show different methodologies for deployment and building in DevOps. |
| 4 | + |
| 5 | +It consists of four services: |
| 6 | +- frontend |
| 7 | +- proxy |
| 8 | +- backend |
| 9 | +- redis |
| 10 | + |
| 11 | +## App diagram with request flow |
| 12 | +``` |
| 13 | + +--------------+ +--------------+ |
| 14 | + | | | | |
| 15 | + | Frontend | | Redis | |
| 16 | + | | | | |
| 17 | + +----------+---+ +----------+---+ |
| 18 | + ^ | ^ | |
| 19 | + | | | | |
| 20 | + 1 2 5 6 |
| 21 | + | | | | |
| 22 | + | v | v |
| 23 | + +----+---------+ +-------------+ +----+---------+ |
| 24 | + | +------3----->| +----4---->| | |
| 25 | + | Client | | Proxy | | Backend | |
| 26 | + | |<-----8------+ |<---7-----+ | |
| 27 | + +--------------+ +-------------+ +--------------+ |
| 28 | +``` |
| 29 | + |
| 30 | +## App UI |
| 31 | + |
| 32 | +The application displays proxy and backend instances with version and hostname. Also displays which instances handled the current connection by connecting them by an arrow. |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +## How to run the application |
| 37 | + |
| 38 | +To start the application `cd` into the **.deployment** folder and either run `dip provision` or `docker-compose up -d`. |
| 39 | + |
| 40 | +In case of docker compose the command will need to be run multiple times because of dependencies, dip tool handles it automatically. |
| 41 | + |
| 42 | +## Folder and file structure |
| 43 | + |
| 44 | +#### Application folders |
| 45 | + |
| 46 | +Whole application is kept in **frontend**, **backend** and **proxy** folders. Each consists of service code, makefile for building and running the application, Dockerfile and files used to deploy to Google Cloud environment. |
| 47 | + |
| 48 | +#### Other folders |
| 49 | + |
| 50 | +- **.build** - builds all components using dip. Used by CI. |
| 51 | +- **.deployment** - deploys whole project using dip. Can be deployed locally or on external server |
| 52 | +- **.github** - stores workflows for Github Actions |
| 53 | +- **ansible** - configures Jenkins server and staging and production environments with auto deployment. To be used with **terraform** folder |
| 54 | +- **doc** - documentation related files |
| 55 | +- **jenkins** - container related files to deploy Jenkins locally |
| 56 | +- **terraform** - code for deploying infrastructure using [Hetzner Cloud](https://www.hetzner.com/) and [Cloudflare](https://www.cloudflare.com/) |
| 57 | +- **testing** - files for testing infrastructure (currently not used) |
| 58 | + |
| 59 | +#### Files |
| 60 | + |
| 61 | +- **Jenkinsfile** - different Jenkinsfiles used by Jenkins |
| 62 | +- **.travis.yml** - Travis CI pipeline |
| 63 | + |
| 64 | +## Author |
| 65 | + |
| 66 | +[Jan Kacik](https://github.com/Consek) |
0 commit comments