Add install dependency tool command.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
4637503626
commit
9112f34b2f
13
Makefile
13
Makefile
|
@ -66,12 +66,8 @@ endif
|
||||||
docker tag $(PRODUCTION_IMAGE):latest $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag)
|
docker tag $(PRODUCTION_IMAGE):latest $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag)
|
||||||
docker push $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag)
|
docker push $(DEPLOY_ACCOUNT)/$(PRODUCTION_IMAGE):$(tag)
|
||||||
|
|
||||||
install:
|
install: tool
|
||||||
@which glide || (curl https://glide.sh/get | sh)
|
@which glide || (curl https://glide.sh/get | sh)
|
||||||
@which go-junit-report || go get -u github.com/jstemmer/go-junit-report
|
|
||||||
@which gocov || go get -u github.com/axw/gocov/gocov
|
|
||||||
@which gocov-xml || go get -u github.com/AlekSi/gocov-xml
|
|
||||||
@which golint || go get -u github.com/golang/lint/golint
|
|
||||||
@glide install
|
@glide install
|
||||||
|
|
||||||
update:
|
update:
|
||||||
|
@ -80,11 +76,8 @@ update:
|
||||||
fmt:
|
fmt:
|
||||||
@echo $(TARGETS_NOVENDOR) | xargs go fmt
|
@echo $(TARGETS_NOVENDOR) | xargs go fmt
|
||||||
|
|
||||||
lint:
|
tool:
|
||||||
@golint -set_exit_status=1 ./...
|
sh ./script/coverage.sh tool
|
||||||
|
|
||||||
vet:
|
|
||||||
@go vet -n -x ./...
|
|
||||||
|
|
||||||
junit_report:
|
junit_report:
|
||||||
sh ./script/coverage.sh junit
|
sh ./script/coverage.sh junit
|
||||||
|
|
|
@ -31,6 +31,7 @@ show_help() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Generate test coverage statistics for Go packages.
|
Generate test coverage statistics for Go packages.
|
||||||
|
|
||||||
|
tool Install go dependency tools like gocov or golint.
|
||||||
testing [set|count|atomic] Run go testing for all packages
|
testing [set|count|atomic] Run go testing for all packages
|
||||||
coverage Generate coverage report for all packages
|
coverage Generate coverage report for all packages
|
||||||
junit Generate coverage xml report for junit plugin
|
junit Generate coverage xml report for junit plugin
|
||||||
|
@ -40,6 +41,13 @@ Generate test coverage statistics for Go packages.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_dependency_tool() {
|
||||||
|
which go-junit-report || go get -u github.com/jstemmer/go-junit-report
|
||||||
|
which gocov || go get -u github.com/axw/gocov/gocov
|
||||||
|
which gocov-xml || go get -u github.com/AlekSi/gocov-xml
|
||||||
|
which golint || go get -u github.com/golang/lint/golint
|
||||||
|
}
|
||||||
|
|
||||||
testing() {
|
testing() {
|
||||||
test -f ${junit_report} && rm -f ${junit_report}
|
test -f ${junit_report} && rm -f ${junit_report}
|
||||||
coverage_mode=$@
|
coverage_mode=$@
|
||||||
|
@ -94,6 +102,8 @@ generate_cloc_report() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"")
|
"")
|
||||||
show_help ;;
|
show_help ;;
|
||||||
|
tool)
|
||||||
|
install_dependency_tool ;;
|
||||||
testing)
|
testing)
|
||||||
mode="set"
|
mode="set"
|
||||||
test -z $2 || mode=$2
|
test -z $2 || mode=$2
|
||||||
|
|
Loading…
Reference in New Issue