From 326e0f2fd3dafcd0e80642f027a221fb18ee31df Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 18:44:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20Ma?= =?UTF-8?q?kefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 build/Makefile diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..53b1e0e --- /dev/null +++ b/build/Makefile @@ -0,0 +1,25 @@ +.DEFAULT_GOAL := build + +GOOS=linux +GOARCH=amd64 +GOBIN=$(shell go env GOPATH)/bin +APP=authService +APP_BINARY=${GOBIN}/${APP}-${GOOS}-${GOARCH} +APP_TAG=slaventius/test3k_auth:latest + +clean: + @echo "cleaning ${APP_BINARY}" + @go clean + @rm ${APP_BINARY} + +build: clean + @echo "building ${APP_BINARY}" + @go build -o ${APP_BINARY} -ldflags "-s -w" ../cmd/main.go + +docker-build: + @echo "building docker-image ${APP_TAG}" + @sudo docker build --no-cache --tag ${APP_TAG} . + +docker-push: docker-build + @echo "pushing docker-image ${APP_TAG}" + @sudo docker push ${APP_TAG} \ No newline at end of file