{"id":318022,"date":"2021-02-15T09:01:58","date_gmt":"2021-02-15T09:01:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=318022"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=318022","title":{"rendered":"\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 GitHub"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u043e\u0441\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a (checklist) \u0438 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Github&#8217;\u0435.<\/p>\n<p>TLDR:<\/p>\n<ul>\n<li>\n<p>Makefile \u043a\u0430\u043a \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u0442\u0435\u0441\u0442\u044b \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>Dockerfile \u043a\u0430\u043a \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>Github Actions \u043a\u0430\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0432\u044b\u043a\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445<\/p>\n<\/li>\n<li>\n<p>Goreleaser \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/github.com\/lesovsky\/pgcenter\" rel=\"noopener noreferrer nofollow\">pgcenter<\/a>.<\/p>\n<hr>\n<p><strong>Disclaimer<\/strong>: \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0432\u0435\u0449\u0435\u0439 \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. <a href=\"https:\/\/gist.github.com\/lesovsky\/fbfac22471a13425a1110ff311dfe43f\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0438\u0441\u043e\u043a<\/a> \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u0412\u0441\u0435 \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0418\u041c\u0425\u041e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0438\u043b\u0438 \u0432\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b\/\u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u0435\u0449\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0438\u043c\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u0441\u0435 \u043e\u043d\u0438 \u0432\u0437\u044f\u0442\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>Makefile<\/h2>\n<p>Makefile \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0441\u0431\u043e\u0440\u043a\u0430 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u0442.\u043f.<\/p>\n<\/li>\n<li>\n<p>\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 SQL \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0412 Makefile \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c Makefile \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u0430\u043c  \u043d\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u0438\u0445 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c  \u0438\u0445 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041f\u043e\u0437\u0436\u0435 Makefile \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u0438\u0445 \u0436\u0435 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0432 CI\/CD. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Makefile \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<\/li>\n<\/ul>\n<pre><code>PROGRAM_NAME = pgcenter  COMMIT=$(shell git rev-parse --short HEAD) BRANCH=$(shell git rev-parse --abbrev-ref HEAD) TAG=$(shell git describe --tags |cut -d- -f1)  LDFLAGS = -ldflags \"-X main.gitTag=${TAG} -X main.gitCommit=${COMMIT} -X main.gitBranch=${BRANCH}\"  .PHONY: help clean dep build install uninstall   .DEFAULT_GOAL := help  help: ## Display this help screen. \t@echo \"Makefile available targets:\" \t@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = \":.*?## \"}; {printf \"  * \\033[36m%-15s\\033[0m %s\\n\", $$1, $$2}'  dep: ## Download the dependencies. \tgo mod download  build: dep ## Build pgcenter executable. \tmkdir -p .\/bin \tCGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} go build ${LDFLAGS} -o bin\/${PROGRAM_NAME} .\/cmd  clean: ## Clean build directory. \trm -f .\/bin\/${PROGRAM_NAME} \trmdir .\/bin<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c Makefile.<\/p>\n<ul>\n<li>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043d\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 Git \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043c\u0438\u0442, \u0442\u0435\u0433 \u0438 \u0432\u0435\u0442\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f  \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 Git \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043d\u0435\u0439, \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c. \u041e\u0442\u043c\u0435\u0447\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u0430\u0433\u0438\u044f,  \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u0432 Git \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0435\u0433\u0438 \u0438 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 Git \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/lesovsky\/pgcenter\/blob\/master\/cmd\/version.go#L19\" rel=\"noopener noreferrer nofollow\">1<\/a> \u0438 <a href=\"https:\/\/github.com\/lesovsky\/pgcenter\/blob\/master\/cmd\/version.go#L24\" rel=\"noopener noreferrer nofollow\">2<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044d\u0442\u043e \u043f\u0443\u043d\u043a\u0442 <strong>help<\/strong>, \u043e\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u043a\u0443 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e Makefile &#8212; \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438  \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0440\u0435\u0448\u0435\u0442\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u043f\u0443\u043d\u043a\u0442\u043e\u0432. \u042d\u0442\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <strong>make<\/strong> \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u043b\u0438 \u044f\u0432\u043d\u043e <strong>make help<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0434\u043b\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u044f \u0438 \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u0445\u043e\u0434\u0443 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<h2>\u041b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u0442\u0435\u0441\u0442\u044b<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 &#171;\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445&#187; \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c \u0441\u0442\u0438\u043b\u044f\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0445\u0443\u0436\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0412 go \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043f\u043e\u043a\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e golangci-lint \u0438 gosec. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0430\u0437\u043d\u044b\u0445 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 (\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0432\u0441\u0435), \u0432\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u043c \u0441 \u0443\u043a\u043b\u043e\u043d\u043e\u043c \u0432 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0445 \u0432 Makefile<\/p>\n<pre><code>lint: dep ## Lint the source files \tgolangci-lint run --timeout 5m -E golint \tgosec -quiet .\/...<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f golangci-lint \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0442\u0430\u0439\u043c\u0430\u0443\u0442, \u0447\u0435\u0440\u0435\u0437 \u0444\u043b\u0430\u0433 -E \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u044b. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 gosec \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432.<\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0447\u0442\u043e golangci-lint \u0438 gosec \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0418\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0442\u0443\u0442 \u043d\u0435 \u0431\u0443\u0434\u0443.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438 \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u0436\u0435. <\/p>\n<pre><code>test: dep ## Run tests \tgo test -race -p 1 -timeout 300s -coverprofile=.test_coverage.txt .\/... &amp;&amp; \\     \tgo tool cover -func=.test_coverage.txt | tail -n1 | awk '{print \"Total test coverage: \" $$3}' \t@rm .test_coverage.txt<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u044d\u0442\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f.<\/p>\n<h2>Dockerfile<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u044d\u0442\u0430\u043f\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Dockerfile, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c Docker \u043e\u0431\u0440\u0430\u0437\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code># stage 1: build FROM golang:1.15 as build LABEL stage=intermediate WORKDIR \/app COPY . . RUN make build  # stage 2: scratch FROM scratch as scratch COPY --from=build \/app\/bin\/pgcenter \/bin\/pgcenter CMD [\"pgcenter\"]<\/code><\/pre>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u044d\u0442\u0430\u043f\u043e\u0432, \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u043e\u0431\u0440\u0430\u0437. \u0422\u0430\u043a\u0438\u043c \u0434\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u0438\u043f\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0438\u043b\u0438 \u0447\u0435\u0433\u043e-\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e. <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0431\u043e\u0440\u043a\u0438 Docker \u043e\u0431\u0440\u0430\u0437\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0435\u0433\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c Docker Hub. \u0414\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043c \u043e\u0431\u0440\u0430\u0437\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b (\u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c).<\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 Makefile.<\/p>\n<pre><code>docker-build: ## Build docker image \tdocker build -t lesovsky\/pgcenter:${TAG} . \tdocker image prune --force --filter label=stage=intermediate  docker-push: ## Push docker image to registry \tdocker push lesovsky\/pgcenter:${TAG}<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f TAG \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 Makefile.<\/p>\n<h2>Github Actions<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (Makefile) \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 (Dockerfile), \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 Github Actions.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u043e\u043f\u0440\u0438\u043a\u0430\u0441\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u0422\u0435\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f, \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u043e\u0432, \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0446\u0435\u043b\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435 \u043a\u0442\u043e \u0432 \u0442\u0435\u043c\u0435 \u0443\u0436\u0435  \u0438 \u0442\u0430\u043a \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u0430 \u043a\u0442\u043e \u043d\u0435 \u0432 \u0442\u0435\u043c\u0435 \u043f\u0443\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/search\/?q=git+flow#h\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0438\u0441\u043a\u0438<\/a> \u0447\u0442\u0438\u0432\u0430 Git Flow, Github Flow, Gitlab Flow \u0438 \u0438\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 master \u0432\u0435\u0442\u043a\u0443. \u041e\u0442 \u0432\u0435\u0442\u043a\u0438 master \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c release \u0432\u0435\u0442\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0440\u0435\u043b\u0438\u0437\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043b\u0438\u0437, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u0433 \u0438 \u043f\u043e\u0434\u0442\u044f\u043d\u0435\u043c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0437 master \u0432 release.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043b\u0438\u0437\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 workflow \u0432 Github Actions. <em>\u041a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0434\u043d\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043b\u043e\u0432\u0443 wokflow \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/em><\/p>\n<p>\u0411\u0443\u0434\u0435\u0442 \u0434\u0432\u0430 workflow:<\/p>\n<ul>\n<li>\n<p>Default (.github\/workflows\/default.yml) &#8212; \u044d\u0442\u043e flow \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>Release (.github\/workflows\/release.yml) &#8212; \u044d\u0442\u043e \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 flow \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b, \u0441\u0431\u043e\u0440\u043a\u0443 Docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0442 workflow \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 push \u0438 pull request \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u0432\u0435\u0442\u043a\u0435 master. \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 (job), \u0437\u0430\u043f\u0443\u0441\u043a \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432. Github Actions \u0438\u043c\u0435\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 workflow.<\/p>\n<pre><code>--- name: Release  on:   push:     branches: [ release ]  jobs:   test:     runs-on: ubuntu-latest     container: lesovsky\/pgcenter-testing:v0.0.1      steps:       - name: Checkout code         uses: actions\/checkout@v2       - name: Prepare test environment         run: prepare-test-environment.sh       - name: Run lint         run: make lint       - name: Run test         run: make test    build:     runs-on: ubuntu-latest     needs: test     steps:       - name: Checkout code         uses: actions\/checkout@v2         with:           fetch-depth: 0       - name: Build image         run: make docker-build       - name: Log in to Docker Hub         run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}       - name: Push image to Docker Hub         run: make docker-push    goreleaser:     runs-on: ubuntu-latest     needs: [ test, build ]     steps:       - uses: actions\/checkout@v2         with:           fetch-depth: 0       - uses: actions\/setup-go@v2         with:           go-version: 1.15       - uses: goreleaser\/goreleaser-action@v2         with:           version: latest           args: release --rm-dist         env:           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}<\/code><\/pre>\n<p>\u0420\u0435\u043b\u0438\u0437\u043d\u044b\u0439 workflow \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u043f\u0440\u0438 push \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0432 release \u0432\u0435\u0442\u043a\u0435. \u042d\u0442\u043e\u0442 workflow \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0434\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 &#8212; build \u0438 goreleaser. <\/p>\n<p>\u0412 \u0437\u0430\u0434\u0430\u0447\u0435 build \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f Docker \u043e\u0431\u0440\u0430\u0437\u0430. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Secrets, \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Github \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. <\/p>\n<p>\u0412 \u0437\u0430\u0434\u0430\u0447\u0435 goreleaser \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0440\u0435\u043b\u0438\u0437\u0430 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Releases \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 goreleaser \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043f\u043e\u0437\u0436\u0435. \u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0435\u043a\u0440\u0435\u0442 <a href=\"https:\/\/docs.github.com\/en\/actions\/reference\/authentication-in-a-workflow#about-the-github_token-secret\" rel=\"noopener noreferrer nofollow\">GITHUB_TOKEN<\/a> \u0435\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f \u043d\u0443\u0436\u0434 workflow.<\/p>\n<h2>Goreleaser<\/h2>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433 \u044d\u0442\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0440\u0435\u043b\u0438\u0437\u0430 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432. \u041a\u0440\u043e\u043c\u0435 Docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u044d\u0442\u043e deb \u0438 rpm \u043f\u0430\u043a\u0435\u0442\u044b. \u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u043d\u0438 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u043d\u044b<br \/> \u0438 \u0438\u0445 \u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443. \u0414\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f goreleaser \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0441\u0431\u043e\u0440\u043a\u0435. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432 <em>.goreleaser.yml<\/em><\/p>\n<pre><code>before:   hooks:   - make dep  builds:   - binary: pgcenter     main: .\/cmd     goarch:       - amd64     goos:       - linux     env:       - CGO_ENABLED=0     ldflags:       - -a -installsuffix cgo       - -X main.gitTag={{.Tag}} -X main.gitCommit={{.Commit}} -X main.gitBranch={{.Branch}}  archives:   - builds: [pgcenter]  changelog:   sort: asc  nfpms:   - vendor: pgcenter     homepage: https:\/\/github.com\/lesovsky\/pgcenter     maintainer: Alexey Lesovsky     description: Command-line admin tool for observing and troubleshooting Postgres.     license: BSD-3     formats: [ deb, rpm ]<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e \u0447\u0442\u043e goreleaser \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 Makefile \u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 goreleaser \u043f\u0440\u0430\u0432\u0438\u043b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 Makefile, \u0442.\u0435. \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u0442\u0435 \u0436\u0435 \u0444\u043b\u0430\u0433\u0438, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0442.\u043f. \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 nfpms \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u043f\u0430\u043a\u0435\u0442\u043e\u0432.  <\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u041c\u043e\u0436\u043d\u043e \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0443\u0448\u0438\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 Actions \u0438 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u0442\u0435\u043c \u043a\u0430\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f workflow. \u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438, \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u0433, \u0438 \u0432\u043b\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u0443\u044e \u0432\u0435\u0442\u0432\u044c \u0438 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u043e\u043c \u0432 Actions.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f &#8212; Go \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u044b.<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/gist.github.com\/lesovsky\/fbfac22471a13425a1110ff311dfe43f\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0438\u0441\u043e\u043a \u0432 gist.github.com<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/golangci\/golangci-lint\" rel=\"noopener noreferrer nofollow\">golangci-lint<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/securego\/gosec\" rel=\"noopener noreferrer nofollow\">gosec<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.docker.com\/develop\/develop-images\/multistage-build\/\" rel=\"noopener noreferrer nofollow\">Docker multi-stage build<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\/quickstart\" rel=\"noopener noreferrer nofollow\">GitHub Actions Quick Start<\/a><\/p>\n<\/li>\n<li>\n<p>Goreleaser: <a href=\"https:\/\/goreleaser.com\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d<\/a> \u0438 <a href=\"https:\/\/github.com\/goreleaser\/goreleaser\" rel=\"noopener noreferrer nofollow\">\u0434\u0432\u0430<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/542410\/\"> https:\/\/habr.com\/ru\/post\/542410\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u043e\u0441\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a (checklist) \u0438 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Github&#8217;\u0435.<\/p>\n<p>TLDR:<\/p>\n<ul>\n<li>\n<p>Makefile \u043a\u0430\u043a \u0432\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u041b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u0442\u0435\u0441\u0442\u044b \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>Dockerfile \u043a\u0430\u043a \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>Github Actions \u043a\u0430\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0432\u044b\u043a\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445<\/p>\n<\/li>\n<li>\n<p>Goreleaser \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 <a href=\"https:\/\/github.com\/lesovsky\/pgcenter\" rel=\"noopener noreferrer nofollow\">pgcenter<\/a>.<\/p>\n<hr>\n<p><strong>Disclaimer<\/strong>: \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0432\u0435\u0449\u0435\u0439 \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. <a href=\"https:\/\/gist.github.com\/lesovsky\/fbfac22471a13425a1110ff311dfe43f\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0438\u0441\u043e\u043a<\/a> \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u0412\u0441\u0435 \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0418\u041c\u0425\u041e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0438\u043b\u0438 \u0432\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b\/\u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u0435\u0449\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u043b\u0443\u0447\u0448\u0435, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u043c\u0443. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u0438\u043c\u0435\u043d \u0444\u0430\u0439\u043b\u043e\u0432, \u0432\u0441\u0435 \u043e\u043d\u0438 \u0432\u0437\u044f\u0442\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>Makefile<\/h2>\n<p>Makefile \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u0441\u0431\u043e\u0440\u043a\u0430 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u0442.\u043f.<\/p>\n<\/li>\n<li>\n<p>\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 SQL \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0412 Makefile \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c Makefile \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u0430\u043c  \u043d\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438 \u0438\u0445 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c  \u0438\u0445 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041f\u043e\u0437\u0436\u0435 Makefile \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u0438\u0445 \u0436\u0435 \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0432 CI\/CD. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Makefile \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<\/li>\n<\/ul>\n<pre><code>PROGRAM_NAME = pgcenter  COMMIT=$(shell git rev-parse --short HEAD) BRANCH=$(shell git rev-parse --abbrev-ref HEAD) TAG=$(shell git describe --tags |cut -d- -f1)  LDFLAGS = -ldflags \"-X main.gitTag=${TAG} -X main.gitCommit=${COMMIT} -X main.gitBranch=${BRANCH}\"  .PHONY: help clean dep build install uninstall   .DEFAULT_GOAL := help  help: ## Display this help screen. \t@echo \"Makefile available targets:\" \t@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = \":.*?## \"}; {printf \"  * \\033[36m%-15s\\033[0m %s\\n\", $$1, $$2}'  dep: ## Download the dependencies. \tgo mod download  build: dep ## Build pgcenter executable. \tmkdir -p .\/bin \tCGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} go build ${LDFLAGS} -o bin\/${PROGRAM_NAME} .\/cmd  clean: ## Clean build directory. \trm -f .\/bin\/${PROGRAM_NAME} \trmdir .\/bin<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c Makefile.<\/p>\n<ul>\n<li>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0444\u0430\u0439\u043b\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043d\u0430\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 Git \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043c\u043c\u0438\u0442, \u0442\u0435\u0433 \u0438 \u0432\u0435\u0442\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f  \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 Git \u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043d\u0435\u0439, \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c. \u041e\u0442\u043c\u0435\u0447\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043d\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u0430\u0433\u0438\u044f,  \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u0432 Git \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u0435\u0433\u0438 \u0438 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 Git \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/github.com\/lesovsky\/pgcenter\/blob\/master\/cmd\/version.go#L19\" rel=\"noopener noreferrer nofollow\">1<\/a> \u0438 <a href=\"https:\/\/github.com\/lesovsky\/pgcenter\/blob\/master\/cmd\/version.go#L24\" rel=\"noopener noreferrer nofollow\">2<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044d\u0442\u043e \u043f\u0443\u043d\u043a\u0442 <strong>help<\/strong>, \u043e\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u043a\u0443 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e Makefile &#8212; \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438  \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0440\u0435\u0448\u0435\u0442\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u043f\u0443\u043d\u043a\u0442\u043e\u0432. \u042d\u0442\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <strong>make<\/strong> \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u043b\u0438 \u044f\u0432\u043d\u043e <strong>make help<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0434\u043b\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 Go \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u0431\u043e\u0440\u043a\u0430 \u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u044f \u0438 \u0431\u0443\u0434\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u0445\u043e\u0434\u0443 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<h2>\u041b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u0442\u0435\u0441\u0442\u044b<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 &#171;\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445&#187; \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u043c \u0441\u0442\u0438\u043b\u044f\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0445\u0443\u0436\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u043e\u0448\u0438\u0431\u043a\u0430\u043c. \u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0412 go \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432, \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u043f\u043e\u043a\u0430 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e golangci-lint \u0438 gosec. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u0440\u0430\u0437\u043d\u044b\u0445 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 (\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0432\u0441\u0435), \u0432\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u043c \u0441 \u0443\u043a\u043b\u043e\u043d\u043e\u043c \u0432 \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u0445 \u0432 Makefile<\/p>\n<pre><code>lint: dep ## Lint the source files \tgolangci-lint run --timeout 5m -E golint \tgosec -quiet .\/...<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f golangci-lint \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0442\u0430\u0439\u043c\u0430\u0443\u0442, \u0447\u0435\u0440\u0435\u0437 \u0444\u043b\u0430\u0433 -E \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u044b. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 gosec \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u043e\u0431\u0445\u043e\u0434 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432.<\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0447\u0442\u043e golangci-lint \u0438 gosec \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0418\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0442\u0443\u0442 \u043d\u0435 \u0431\u0443\u0434\u0443.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0438 \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u0436\u0435. <\/p>\n<pre><code>test: dep ## Run tests \tgo test -race -p 1 -timeout 300s -coverprofile=.test_coverage.txt .\/... &amp;&amp; \\     \tgo tool cover -func=.test_coverage.txt | tail -n1 | awk '{print \"Total test coverage: \" $$3}' \t@rm .test_coverage.txt<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u044d\u0442\u0438\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0438 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f.<\/p>\n<h2>Dockerfile<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u044d\u0442\u0430\u043f\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Dockerfile, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c Docker \u043e\u0431\u0440\u0430\u0437\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code># stage 1: build FROM golang:1.15 as build LABEL stage=intermediate WORKDIR \/app COPY . . RUN make build  # stage 2: scratch FROM scratch as scratch COPY --from=build \/app\/bin\/pgcenter \/bin\/pgcenter CMD [\"pgcenter\"]<\/code><\/pre>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043e\u0431\u0440\u0430\u0437\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u044d\u0442\u0430\u043f\u043e\u0432, \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0443\u0441\u0442\u043e\u0439 \u043e\u0431\u0440\u0430\u0437. \u0422\u0430\u043a\u0438\u043c \u0434\u0432\u0443\u0445\u044d\u0442\u0430\u043f\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0442\u0438\u043f\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0438\u043b\u0438 \u0447\u0435\u0433\u043e-\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e. <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0431\u043e\u0440\u043a\u0438 Docker \u043e\u0431\u0440\u0430\u0437\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0435\u0433\u043e \u0437\u0430\u0431\u0440\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c Docker Hub. \u0414\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043c \u043e\u0431\u0440\u0430\u0437\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b (\u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c).<\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 Makefile.<\/p>\n<pre><code>docker-build: ## Build docker image \tdocker build -t lesovsky\/pgcenter:${TAG} . \tdocker image prune --force --filter label=stage=intermediate  docker-push: ## Push docker image to registry \tdocker push lesovsky\/pgcenter:${TAG}<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f TAG \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 Makefile.<\/p>\n<h2>Github Actions<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (Makefile) \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 (Dockerfile), \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 Github Actions.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u043e\u043f\u0440\u0438\u043a\u0430\u0441\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430. \u0422\u0435\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f, \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u043e\u0432, \u0432\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0446\u0435\u043b\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435 \u043a\u0442\u043e \u0432 \u0442\u0435\u043c\u0435 \u0443\u0436\u0435  \u0438 \u0442\u0430\u043a \u0432\u0441\u0435 \u0437\u043d\u0430\u044e\u0442, \u0430 \u043a\u0442\u043e \u043d\u0435 \u0432 \u0442\u0435\u043c\u0435 \u043f\u0443\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/search\/?q=git+flow#h\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0438\u0441\u043a\u0438<\/a> \u0447\u0442\u0438\u0432\u0430 Git Flow, Github Flow, Gitlab Flow \u0438 \u0438\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 master \u0432\u0435\u0442\u043a\u0443. \u041e\u0442 \u0432\u0435\u0442\u043a\u0438 master \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c release \u0432\u0435\u0442\u043a\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0440\u0435\u043b\u0438\u0437\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043b\u0438\u0437, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u0433 \u0438 \u043f\u043e\u0434\u0442\u044f\u043d\u0435\u043c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0437 master \u0432 release.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043b\u0438\u0437\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 workflow \u0432 Github Actions. <em>\u041a\u0442\u043e \u0437\u043d\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0434\u043d\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043b\u043e\u0432\u0443 wokflow \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/em><\/p>\n<p>\u0411\u0443\u0434\u0435\u0442 \u0434\u0432\u0430 workflow:<\/p>\n<ul>\n<li>\n<p>Default (.github\/workflows\/default.yml) &#8212; \u044d\u0442\u043e flow \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>Release (.github\/workflows\/release.yml) &#8212; \u044d\u0442\u043e \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 flow \u0434\u0435\u043b\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u044b, \u0441\u0431\u043e\u0440\u043a\u0443 Docker \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e\u0442 workflow \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 push \u0438 pull request \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u0432\u0435\u0442\u043a\u0435 master. \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 (job), \u0437\u0430\u043f\u0443\u0441\u043a \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432. Github Actions \u0438\u043c\u0435\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 workflow.<\/p>\n<pre><code>--- name: Release  on:   push:     branches: [ release ]  jobs:   test:     runs-on: ubuntu-latest     container: lesovsky\/pgcenter-testing:v0.0.1      steps:       - name: Checkout code         uses: actions\/checkout@v2       - name: Prepare test environment         run: prepare-test-environment.sh       - name: Run lint         run: make lint       - name: Run test         run: make test    build:     runs-on: ubuntu-latest     needs: test     steps:       - name: Checkout code         uses: actions\/checkout@v2         with:           fetch-depth: 0       - name: Build image         run: make docker-build       - name: Log in to Docker Hub         run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}       - name: Push image to Docker Hub         run: make docker-push    goreleaser:     runs-on: ubuntu-latest     needs: [ test, build ]     steps:       - uses: actions\/checkout@v2         with:           fetch-depth: 0       - uses: actions\/setup-go@v2         with:           go-version: 1.15       - uses: goreleaser\/goreleaser-action@v2         with:           version: latest           args: release --rm-dist         env:           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}<\/code><\/pre>\n<p>\u0420\u0435\u043b\u0438\u0437\u043d\u044b\u0439 workflow \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u043d \u043f\u0440\u0438 push \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0432 release \u0432\u0435\u0442\u043a\u0435. \u042d\u0442\u043e\u0442 workflow \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432 \u0438 \u0442\u0435\u0441\u0442\u043e\u0432. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0434\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 &#8212; build \u0438 goreleaser. <\/p>\n<p>\u0412<\/p>\n<\/hr>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-318022","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318022"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/318022\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}