mxssl / sre-test-task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Report Card

SRE test task

Diagram

GCP diagram

Build&Deploy Scripts

Local setup with docker-compose

Use this command:

docker-compose up -d

You can get api via http://localhost:8080

Local dev

  1. Install go
  2. Install godep
  3. Install golangci-lint
  4. Install dependencies
make dep
  1. Run linter
make lint
  1. Run db for local dev
docker \
  run \
  -d \
  -e POSTGRES_DB=app \
  -e POSTGRES_USER=user \
  -e POSTGRES_PASSWORD=password \
  -p "5432:5432" \
  postgres
  1. Declare env variables
export DB_HOST="your_db_ip"
export DB_PORT="your_db_port"
export DB_USER="your_db_user"
export DB_NAME="your_db_name"
export DB_PASSWORD="your_db_password"
  1. Run tests
make test
  1. Build the app
make build
  1. Run the app
./app
  1. Stop the app
ctrl + c
  1. Remove the binary
make clean

About


Languages

Language:Go 90.9%Language:Dockerfile 4.5%Language:Makefile 2.4%Language:Shell 2.2%