summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-08 08:34:47 +0000
committerGitHub <[email protected]>2020-12-08 08:34:47 +0000
commita60d0523c1afb6c1983b522d1477b8ef319d5b99 (patch)
tree8b268a842014cff3431e898e4b7f3e267ee7cd81 /Makefile
parentb22078ce707d21ac17ea1727a4174c44ef57ae69 (diff)
parentd410a76d7ccef826fc5b1921314f88a902f1d10c (diff)
Merge #433
433: Releases and binaries build automation r=48d90782 a=tarampampam This PR contains: - [x] CI steps for automatic release distributive creation and uploading to github release - [x] CI step for automatic docker image creation (on GitHub side, not `hub.docker.com`) - [x] `build.sh` script removal - [x] Binary file building in `Dockerfile` using `go build` (not `build.sh`) - [x] Docker labels with app version and build time - [x] `Makefile` cleaning - [x] `./bin/rr` now do not depends from `build.sh` file and use [`composer/package-versions-deprecated`](https://github.com/composer/package-versions-deprecated) package for "self version reading" > :warning: Steps, that must be done before merging described [here](https://github.com/spiral/roadrunner/pull/433#issuecomment-740426206) Closes #431 Co-authored-by: paramtamtam <[email protected]> Co-authored-by: Paramtamtam <[email protected]>
Diffstat (limited to 'Makefile')
-rwxr-xr-x[-rw-r--r--]Makefile39
1 files changed, 27 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index d7e85f90..bb1e1975 100644..100755
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,29 @@
-build:
- @./build.sh
-all:
- @./build.sh all
-clean:
- rm -rf rr
-install: all
+#!/usr/bin/make
+# Makefile readme (ru): <http://linux.yaroslavl.ru/docs/prog/gnu_make_3-79_russian_manual.html>
+# Makefile readme (en): <https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents>
+
+SHELL = /bin/sh
+
+.DEFAULT_GOAL := build
+
+# This will output the help for each task. thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
+help: ## Show this help
+ @printf "\033[33m%s:\033[0m\n" 'Available commands'
+ @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf " \033[32m%-14s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
+
+build: ## Build RR binary file for local os/arch
+ CGO_ENABLED=0 go build -trimpath -ldflags "-s" -o ./rr ./cmd/rr/main.go
+
+clean: ## Make some clean
+ rm ./rr
+
+install: build ## Build and install RR locally
cp rr /usr/local/bin/rr
-uninstall:
+
+uninstall: ## Uninstall locally installed RR
rm -f /usr/local/bin/rr
-test:
- composer update
+
+test: ## Run application tests
go test -v -race -cover
go test -v -race -cover ./util
go test -v -race -cover ./service
@@ -23,6 +37,7 @@ test:
go test -v -race -cover ./service/health
go test -v -race -cover ./service/gzip
go test -v -race -cover ./service/reload
-lint:
+
+lint: ## Run application linters
go fmt ./...
- golint ./... \ No newline at end of file
+ golint ./...