Skip to content

Commit 261db9e

Browse files
committed
Fix cmd version of kamimai and bump up
1 parent 8f43978 commit 261db9e

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ HAVE_GOLINT:=$(shell which golint)
99
HAVE_GOCYCLO:=$(shell which gocyclo)
1010
HAVE_GOCOV:=$(shell which gocov)
1111
GLIDE_VERSION='v0.12.2'
12-
VERSION=$(patsubst "%",%,$(lastword $(shell grep 'const version' kamimai.go)))
12+
VERSION=$(patsubst "%",%,$(lastword $(shell grep 'const Version' kamimai.go)))
1313
COMMITISH=$(shell git rev-parse HEAD)
1414
PROJECT_REPONAME=kamimai
1515
PROJECT_USERNAME=eure
@@ -20,6 +20,10 @@ ARTIFACTS_DIR=artifacts
2020
init: install-deps
2121

2222
build: install-deps
23+
go build -o /tmp/kamimai -ldflags="-s -w" github.com/$(PROJECT_USERNAME)/$(PROJECT_REPONAME)/cmd/kamimai
24+
25+
install: install-deps
26+
go install -ldflags="-s -w" github.com/$(PROJECT_USERNAME)/$(PROJECT_REPONAME)/cmd/kamimai
2327

2428
unit: lint vet cyclo build test
2529
unit-report: lint vet cyclo build test-report
@@ -36,8 +40,11 @@ vet:
3640
@go tool vet -all -structtags -shadow $(shell ls -d */ | grep -v "misc" | grep -v "vendor")
3741

3842
cyclo: gocyclo
39-
@echo "gocyclo -over 30"
40-
@gocyclo -over 30 ./core
43+
@echo "gocyclo -over 20"
44+
@cyclo=`gocyclo -over 20 .`; \
45+
cyclo=`echo "$$cyclo" | grep -E -v -e vendor/`; \
46+
echo "$$cyclo"; \
47+
if [ "$$cyclo" != "" ]; then exit 1; fi
4148

4249
test:
4350
@go test $(TARGET_ONLY_PKGS)
@@ -101,7 +108,7 @@ verify-github-token:
101108

102109
gox-build: gox
103110
@mkdir -p $(ARTIFACTS_DIR)/$(VERSION) && cd $(ARTIFACTS_DIR)/$(VERSION); \
104-
gox -ldflags="-s -w" github.com/eure/kamimai/cmd/kamimai
111+
gox -ldflags="-s -w" github.com/$(PROJECT_USERNAME)/$(PROJECT_REPONAME)/cmd/kamimai
105112

106113
release: ghr verify-github-token gox-build
107114
@ghr -c $(COMMITISH) -u $(PROJECT_USERNAME) -r $(PROJECT_REPONAME) -t $$GITHUB_TOKEN \

cmd/kamimai/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
"text/template"
99

10+
"github.com/eure/kamimai"
1011
"github.com/eure/kamimai/core"
1112
_ "github.com/eure/kamimai/driver"
1213
)
@@ -74,7 +75,7 @@ func usage() {
7475
"name": "kamimai",
7576
"description": "kamimai is a database migration management system.",
7677
"usage": "kamimai [global options] command [command options] [arguments...]",
77-
"version": "0.0.1",
78+
"version": kamimai.Version,
7879
"author": "kaneshin <kaneshin0120@gmail.com>",
7980
}
8081

kamimai.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import (
66
"github.com/eure/kamimai/core"
77
)
88

9-
const version = "v0.1.1"
9+
// Version represents kamimai's semantic version.
10+
const Version = "v0.2.0"
1011

1112
// Current returns the current migration version.
1213
func Current(c *core.Config) (uint64, error) {

0 commit comments

Comments
 (0)