-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy #12
Deploy #12
Conversation
…2_Team7 into deploy # Conflicts: # docker-compose.yml
# Conflicts: # internal/user/repository/get_subscribers.go
# Conflicts: # internal/event/repository/delete_event_from_favorites_test.go # internal/user/repository/users.go
- run: | ||
sudo apt-get install libwebp-dev | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На будущее - вместо setup-go можно использовать параметр contaner, чтобы использовать для джобы любой нужный контейнер с докерхаба
run: | | ||
echo "GOROOT=$(go env GOROOT)" >> $GITHUB_ENV | ||
echo "GOBIN=$(go env GOBIN)" >> $GITHUB_ENV | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для golangci-lint есть официальный github action, но так тоже сойдет
.github/workflows/deploy.yml
Outdated
with: | ||
go-version: '1.23.1' | ||
- name: Build | ||
run: go build -v ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не совсем понятно, зачем билдить явно перед тестами
echo "Using Commit Hash: ${{ env.COMMIT_HASH }}" | ||
cd back | ||
echo "Pulling latest code from deploy branch..." | ||
git pull origin deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Чет костыльно. По идее надо пушить бинарники на машину, а не пуллить. Но, конечно, править поздновато
func (h *AuthHandlers) Login(w http.ResponseWriter, r *http.Request) { | ||
_, ok := utils.GetSessionFromContext(r.Context()) | ||
if ok { | ||
utils.WriteResponse(w, http.StatusForbidden, httpErrors.ErrUserAlreadyLoggedIn) | ||
return | ||
} | ||
|
||
body, err := io.ReadAll(r.Body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У easyjson есть методы, которые прямо из io.Reader могут читать в структуру, лучше их использовать
|
||
# Прокси для фронтенда | ||
location / { | ||
proxy_pass http://frontend:8000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
До сих пор поднимаете фронтенд-сервер?
|
||
clean: | ||
rm -rf $(BIN_DIR) | ||
|
||
coverage: | ||
go test $(go list ./... | grep -vE '/mocks|/docs|/vendor|/api|_easyjson.go') -coverprofile=coverage.out -coverpkg=$(go list ./... | grep -vE '/mocks|/vendor|/api|/docs|_easyjson.go' | tr '\n' ,) && go tool cover -func=coverage.out | grep total |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вынести бы в переменную исключаемые пакеты, а так норм
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что-то не вижу в конфиге http2
No description provided.