From bdf458614b768a2ec039dc1ce359a29d5b7978f4 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 18:46:15 +0300 Subject: [PATCH] * --- 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..f7d56a0 --- /dev/null +++ b/build/Makefile @@ -0,0 +1,25 @@ +.DEFAULT_GOAL := build + +GOOS=linux +GOARCH=amd64 +GOBIN=$(shell go env GOPATH)/bin +APP=authDBService +APP_BINARY=${GOBIN}/${APP}-${GOOS}-${GOARCH} +APP_TAG=slaventius/test3k_auth_db: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