From 24d792e0c8f35d24cf7d8df88d0e33545c4e581c Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 18:49:14 +0300 Subject: [PATCH] * --- README.md | 7 +------ build/Makefile | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 build/Makefile diff --git a/README.md b/README.md index c91fdeb..6b7c481 100644 --- a/README.md +++ b/README.md @@ -1,6 +1 @@ -# authPostman - -* http://git.slaventius.ru/test3k/authPostman.git -* docker build --no-cache --tag slaventius/test3k_auth_postman:latest ./build/ -* docker push slaventius/test3k_auth_postman:latest - +# authPostman \ No newline at end of file diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..0a336c8 --- /dev/null +++ b/build/Makefile @@ -0,0 +1,25 @@ +.DEFAULT_GOAL := build + +GOOS=linux +GOARCH=amd64 +GOBIN=$(shell go env GOPATH)/bin +APP=authPostmanService +APP_BINARY=${GOBIN}/${APP}-${GOOS}-${GOARCH} +APP_TAG=slaventius/test3k_auth_postman: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