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