Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
GRPC_HOST=localhost
GRPC_PORT=50051

PG_DATABASE_NAME=auth
PG_USER=auth-user
PG_PASSWORD=auth-password
PG_PORT=54321
MIGRATION_DIR=./migrations
61 changes: 0 additions & 61 deletions .github/workflows/yandex-cloud-ci.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
/bin/
.env
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ RUN go build -o ./bin/auth-server cmd/server/main.go
FROM alpine:3.21
WORKDIR /root/
COPY --from=builder /auth-service/bin/auth-server .
COPY .env .

CMD ["./auth-server"]
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
LOCAL_BIN:=$(CURDIR)/bin
include .env

LOCAL_BIN=$(CURDIR)/bin

LOCAL_MIGRATION_DIR=$(MIGRATION_DIR)
LOCAL_MIGRATION_DSN="host=${DB_HOST}port=$(PG_PORT) dbname=$(PG_DATABASE_NAME) user=$(PG_USER) password=$(PG_PASSWORD) sslmode=disable"

lint:
$(LOCAL_BIN)/golangci-lint run ./... --config .golangci.pipeline.yaml
Expand All @@ -7,10 +12,14 @@ install-deps:
GOBIN=$(LOCAL_BIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
GOBIN=$(LOCAL_BIN) go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
GOBIN=$(LOCAL_BIN) go install -mod=mod google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
GOBIN=$(LOCAL_BIN) go install github.com/pressly/goose/v3/cmd/goose@v3.14.0

get-deps:
go get -u google.golang.org/protobuf/cmd/protoc-gen-go
go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
go get -u github.com/jackc/pgx/v5
go get -u google.golang.org/grpc
go get -u golang.org/x/crypto

generate-api:
mkdir -p pkg/user/v1
Expand All @@ -31,3 +40,18 @@ copy-to-server: build
docker-build-and-push:
docker buildx build --no-cache --platform linux/amd64 -t cr.yandex/crpq9mbu5a8g6imqo2g4/auth:0.0.1 .
docker push cr.yandex/crpq9mbu5a8g6imqo2g4/auth:0.0.1

# Goose (migrations)
local-migration-status:
$(LOCAL_BIN)/goose -dir ${LOCAL_MIGRATION_DIR} postgres ${LOCAL_MIGRATION_DSN} status -v

local-migration-up:
$(LOCAL_BIN)/goose -dir ${LOCAL_MIGRATION_DIR} postgres ${LOCAL_MIGRATION_DSN} up -v

local-migration-down:
$(LOCAL_BIN)/goose -dir ${LOCAL_MIGRATION_DIR} postgres ${LOCAL_MIGRATION_DSN} down -v

rebuild:
docker compose down
docker compose build --no-cache
docker compose up -d
Loading