Browse Source

rename files

pull/202/head
yedf2 4 years ago
parent
commit
85e01feb44
  1. 2
      .github/workflows/tests.yml
  2. 2
      .gitignore
  3. 74
      Makefile
  4. 31
      docker-compose.yml
  5. 2
      helper/README-cn.md
  6. 0
      helper/README-en.md
  7. 0
      helper/bench/Makefile
  8. 2
      helper/bench/main.go
  9. 0
      helper/bench/prepare.sh
  10. 0
      helper/bench/setup-redis6.sh
  11. 0
      helper/bench/setup.sh
  12. 0
      helper/bench/svr/http.go
  13. 0
      helper/bench/test-boltdb.sh
  14. 0
      helper/bench/test-flash-sales.sh
  15. 0
      helper/bench/test-mysql.sh
  16. 0
      helper/bench/test-redis.sh
  17. 4
      helper/golint.sh

2
.github/workflows/tests.yml

@ -49,7 +49,7 @@ jobs:
go mod download
- name: Run CI lint
run: make lint
run: sh helper/golint.sh
- name: Run test cover
run: sh helper/test-cover.sh

2
.gitignore

@ -9,6 +9,8 @@ dist
default.etcd
*/**/*.bolt
bench/bench
helper/bench/bench
helper/qs/qs
# Output file of unit test coverage
coverage.*
profile.*

74
Makefile

@ -1,74 +0,0 @@
# The old school Makefile, following are required targets. The Makefile is written
# to allow building multiple binaries. You are free to add more targets or change
# existing implementations, as long as the semantics are preserved.
#
# make - default to 'build' target
# make lint - code analysis
# make test - run unit test (or plus integration test)
# make clean - clean up targets
#
#
# The makefile is also responsible to populate project version information.
#
#
# Tweak the variables based on your project.
#
#
# These variables should not need tweaking.
#
# It's necessary to set this because some environments don't link sh -> bash.
export SHELL := /bin/bash
# It's necessary to set the errexit flags for the bash shell.
export SHELLOPTS := errexit
# Project output directory.
OUTPUT_DIR := ./bin
# Current version of the project.
VERSION ?= $(shell git describe --tags --always --dirty)
BRANCH ?= $(shell git branch | grep \* | cut -d ' ' -f2)
GITCOMMIT ?= $(shell git rev-parse HEAD)
GITTREESTATE ?= $(if $(shell git status --porcelain),dirty,clean)
BUILDDATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
appVersion ?= $(VERSION)
# Track code version with Docker Label.
DOCKER_LABELS ?= git-describe="$(shell date -u +v%Y%m%d)-$(shell git describe --tags --always --dirty)"
# Golang standard bin directory.
GOPATH ?= $(shell go env GOPATH)
BIN_DIR := $(GOPATH)/bin
GOLANGCI_LINT := $(BIN_DIR)/golangci-lint
# Default golang flags used in build and test
# -count: run each test and benchmark 1 times. Set this flag to disable test cache
export GOFLAGS ?= -count=1
#
# Define all targets. At least the following commands are required:
#
# All targets.
.PHONY: lint test
# more info about `GOGC` env: https://github.com/golangci/golangci-lint#memory-usage-of-golangci-lint
lint: $(GOLANGCI_LINT) $(HELM_LINT)
@$(GOLANGCI_LINT) run
$(GOLANGCI_LINT):
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(BIN_DIR) v1.41.0
test:
@go test -v -race -gcflags=-l -coverpkg=./... -coverprofile=coverage.out.tmp ./...
@go tool cover -func coverage.out | tail -n 1 | awk '{ print "Total coverage: " $$3 }'
.PHONY: clean
clean:
@-rm -vrf ${OUTPUT_DIR} output coverage.out coverage.out.tmp

31
docker-compose.yml

@ -1,31 +0,0 @@
version: '3.3'
services:
api:
image: 'yedf/dtm'
environment:
IS_DOCKER: '1'
ports:
- '36789:36789'
- '36790:36790'
volumes:
- .:/app/work
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
command: ['/app/dtm/main', 'dev']
working_dir: /app/work
extra_hosts:
- 'host.docker.internal:host-gateway'
db:
image: 'mysql:5.7'
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
command:
[
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci',
]
ports:
- '3306:3306'

2
README-cn.md → helper/README-cn.md

@ -28,7 +28,7 @@ DTM是一款变革性的分布式事务框架,提供了傻瓜式的使用方
## 亮点
* 极易接入
* 极易上手
- 零配置启动服务,提供非常简单的HTTP接口,极大降低上手分布式事务的难度,新手也能快速接入
* 跨语言
- 可适合多语言栈的公司使用。方便go、python、php、nodejs、ruby、c# 各类语言使用。

0
README-en.md → helper/README-en.md

0
bench/Makefile → helper/bench/Makefile

2
bench/main.go → helper/bench/main.go

@ -4,12 +4,12 @@ import (
"fmt"
"os"
"github.com/dtm-labs/dtm/bench/svr"
"github.com/dtm-labs/dtm/dtmcli"
"github.com/dtm-labs/dtm/dtmcli/logger"
"github.com/dtm-labs/dtm/dtmsvr"
"github.com/dtm-labs/dtm/dtmsvr/config"
"github.com/dtm-labs/dtm/dtmsvr/storage/registry"
"github.com/dtm-labs/dtm/helper/bench/svr"
"github.com/dtm-labs/dtm/test/busi"
)

0
bench/prepare.sh → helper/bench/prepare.sh

0
bench/setup-redis6.sh → helper/bench/setup-redis6.sh

0
bench/setup.sh → helper/bench/setup.sh

0
bench/svr/http.go → helper/bench/svr/http.go

0
bench/test-boltdb.sh → helper/bench/test-boltdb.sh

0
bench/test-flash-sales.sh → helper/bench/test-flash-sales.sh

0
bench/test-mysql.sh → helper/bench/test-mysql.sh

0
bench/test-redis.sh → helper/bench/test-redis.sh

4
helper/golint.sh

@ -0,0 +1,4 @@
set -x
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.0
$(go env GOPATH)/bin/golangci-lint run
Loading…
Cancel
Save