From 2244224b120525b31109a98f99b59d03ab4de699 Mon Sep 17 00:00:00 2001 From: Dan Cech Date: Mon, 25 Apr 2016 12:44:26 -0400 Subject: [PATCH 1/2] add basic Makefile, remove need for global grunt-cli --- Makefile | 17 +++++++++++++++++ README.md | 4 +--- build.go | 2 +- package.json | 1 + 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..ccf8246cabf --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +all: deps build + +deps: + go run build.go setup + godep restore + npm install + +build: + go run build.go build + npm run build + +test: + godep go test -v ./pkg/... + npm run test + +run: + ./bin/grafana-server diff --git a/README.md b/README.md index 931055349cf..d538ba78e1e 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,7 @@ npm (v2.5.0) and grunt (v0.4.5). Run the following: ```bash npm install -npm install -g grunt-cli -grunt +npm run build ``` ### Recompile backend on source change @@ -145,4 +144,3 @@ please [sign the CLA](http://docs.grafana.org/project/cla/) Grafana is distributed under Apache 2.0 License. Work in progress Grafana 2.0 (with included Grafana backend) - diff --git a/build.go b/build.go index 93b9e6db087..0965a405e70 100644 --- a/build.go +++ b/build.go @@ -306,7 +306,7 @@ func ChangeWorkingDir(dir string) { } func grunt(params ...string) { - runPrint("./node_modules/grunt-cli/bin/grunt", params...) + runPrint("./node_modules/.bin/grunt", params...) } func setup() { diff --git a/package.json b/package.json index e71a9049dde..e314476f999 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "npm": "2.14.x" }, "scripts": { + "build": "grunt", "test": "grunt test", "coveralls": "grunt karma:coveralls && rm -rf ./coverage" }, From 650bb4c719800c3ec9ac66927f9b963f737f1ec9 Mon Sep 17 00:00:00 2001 From: Dan Cech Date: Mon, 25 Apr 2016 12:53:15 -0400 Subject: [PATCH 2/2] use npm test to run npm tests --- Makefile | 2 +- circle.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ccf8246cabf..6cccaa7f64b 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ build: test: godep go test -v ./pkg/... - npm run test + npm test run: ./bin/grafana-server diff --git a/circle.yml b/circle.yml index 22dab8ab893..02f9f91e103 100644 --- a/circle.yml +++ b/circle.yml @@ -25,12 +25,12 @@ test: # Go test - godep go test -v ./pkg/... # js tests - - ./node_modules/grunt-cli/bin/grunt test + - npm test - npm run coveralls deployment: master: branch: master owner: grafana - commands: + commands: - ./trigger_grafana_packer.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}