Created
May 8, 2022 16:06
-
-
Save iolalla/f0aad720f0a49ea68d9e5a42eba7a0ca to your computer and use it in GitHub Desktop.
Golang Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
help: ## show help message | |
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | |
build: ## "Building a valid production binary" | |
echo "Building a valid production binary" | |
go build -o play | |
bu: ## "Looks like we have a binary ready to debug" | |
echo "Looks like we have a binary ready to debug" | |
go build -gcflags="all=-N -l" -o play | |
package: ## "Compiling for production and prepare docker" | |
echo "Compiling for production and prepare docker" | |
go build -o play | |
docker build -t play . | |
ds: ## "Run DataStore Server" | |
echo "Run DataStore Server" | |
gcloud beta emulators datastore start --data-dir /home/iolalla/src/gostocks/play/datastore --consistency 1 | |
send: ## "Send the build image to the registry" | |
echo "Send the build image to the registry" | |
gcloud builds submit --tag gcr.io/game-bolsa/play | |
test: ## "Run tests" | |
echo "Run tests" | |
go clean -testcache | |
go test -v ./... | |
all: package send ## "Executes package and send" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment