-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (48 loc) · 1.78 KB
/
Makefile
File metadata and controls
58 lines (48 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.PHONY: default
default: help;
include .env
IMAGE := 'matchilling/github-metrics:latest'
CARBON_PLAINTEXT_PORT :=2003
STACK_SLUG := 'github-metrics'
help: ## Show this help
@echo '----------------------------------------------------------------------'
@echo $(STACK_SLUG)
@echo '----------------------------------------------------------------------'
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
@echo '----------------------------------------------------------------------'
build: ## Build app
@docker build \
--file Dockerfile \
--tag ${DOCKER_ACCOUNT}/${STACK_SLUG}:latest .
collect: ## Run collector
@docker run \
--env GITHUB_TOKEN=${GITHUB_TOKEN} \
--env DATABASE_PATH=${DATABASE_PATH} \
--volume data:/opt/github-metrics/data \
${IMAGE} npm start --silent collect ${owner} ${repository}
export-csv: ## Run csv export
@docker run \
--env GITHUB_TOKEN=${GITHUB_TOKEN} \
--env DATABASE_PATH=${DATABASE_PATH} \
--volume data:/opt/github-metrics/data \
${IMAGE} npm start --silent export:csv
export-graphite: ## Run graphite export
@docker run \
--env GITHUB_TOKEN=${GITHUB_TOKEN} \
--env DATABASE_PATH=${DATABASE_PATH} \
--volume data:/opt/github-metrics/data \
${IMAGE} npm start --silent export:graphite ${owner} ${repository}
push-image: ## Release image
@docker push ${DOCKER_ACCOUNT}/${STACK_SLUG}:latest
graphite: ## Builds and runs a graphite container
@docker run -d \
--name $(STACK_SLUG)-graphite \
--restart=always\
-p 80:80\
-p $(CARBON_PLAINTEXT_PORT)-2004:$(CARBON_PLAINTEXT_PORT)-2004\
-p 2023-2024:2023-2024\
-p 8125:8125/udp\
-p 8126:8126\
graphiteapp/graphite-statsd
test: ## Execute tests
@npm test