Skip to content

Commit c92bcec

Browse files
committed
Add make target for collector
1 parent e68fa11 commit c92bcec

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.PHONY: default
2+
default: help;
3+
4+
include .env
5+
6+
CARBON_PLAINTEXT_PORT :=2003
7+
STACK_SLUG := 'github-metrics'
8+
9+
help: ## Show this help
10+
@echo '----------------------------------------------------------------------'
11+
@echo $(STACK_SLUG)
12+
@echo '----------------------------------------------------------------------'
13+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
14+
@echo '----------------------------------------------------------------------'
15+
16+
test: ## Execute tests
17+
@npm test
18+
19+
run-collect:
20+
@docker run \
21+
--env GITHUB_TOKEN=${GITHUB_TOKEN} \
22+
--env DATABASE_PATH=${DATABASE_PATH} \
23+
--volume data:/opt/github-metrics/data \
24+
--name $(STACK_SLUG)-app \
25+
${STACK_SLUG}-app npm start collect ${OWNER} ${REPO}
26+
27+
build-collect:
28+
@docker build . \
29+
--file Dockerfile \
30+
--tag ${STACK_SLUG}-app
31+
32+
run-graphite: ## Builds and runs a graphite container
33+
@docker run -d \
34+
--name $(STACK_SLUG)-graphite \
35+
--restart=always\
36+
-p 80:80\
37+
-p $(CARBON_PLAINTEXT_PORT)-2004:$(CARBON_PLAINTEXT_PORT)-2004\
38+
-p 2023-2024:2023-2024\
39+
-p 8125:8125/udp\
40+
-p 8126:8126\
41+
graphiteapp/graphite-statsd

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,11 @@ EOL
6767

6868
$ docker-compose up
6969
```
70+
71+
### Docker
72+
73+
```sh
74+
# Collector
75+
$ make build-collect
76+
$ make run-collect OWNER=facebook REPO=react
77+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "github-metrics-graphite-exporter",
2+
"name": "github-metrics",
33
"version": "1.0.0",
44
"description": "[![Build Status](https://travis-ci.org/matchilling/github-metrics-graphite-exporter.svg?branch=master)](https://travis-ci.org/matchilling/github-metrics-graphite-exporter)",
55
"main": "src/cli.js",

0 commit comments

Comments
 (0)