madswolf / Devoops

A C# repository for the Devops course at ITU
MIT License
3 stars 0 forks source link

Minitwit

This is an asp.net application created for the course Devops 2022 on ITU. It uses and ELK stack for logging, Prometheus and Grafana for monitoring, and a PSQL database for storage.

Made by:

Static analysis

Better code

BCH compliance

Sonarcloud

Bugs Code Smells Duplicated Lines (%) Lines of Code Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Code Climate

Maintainability

Main application

Prerequisites

  1. Docker
  2. A PSQL database
  3. An ELK stack
  4. (deploy) python

Running (locally)

  1. Set environment variables:

    • DATABASE_CONNECTION_STRING
    • ELASTICSEARCH_CONNECTION_STRING (host + basic authentication)
  2. set replicas in the docker-compose file to 1

  3. Run docker compose up

Deploying

  1. Set environment variables:
    • SSH_KEY_FOOTPRINT
    • DIGITAL_API_TOKEN
    • DATABASE_CONNECTION_STRING
    • ELASTICSEARCH_CONNECTION_STRING (host + basic authentication)
  2. Run python script/deployscripts/deploy_docker_swarm.py

Supporting deployments/applications

See Logging and Monitoring folders' readme's for instructions

PSQL database

Prerequisites

  1. dotnet-ef cli tool
  2. Fresh PSQL database

Initialise

  1. Navigate to aspnet/Minitwit
  2. set Environment variable "DATABASE_CONNECTION_STRING"
  3. Run dotnet ef database update