-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.35 KB
/
Makefile
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
SHELL = /bin/bash -o pipefail
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
DOCKER_LOCAL := danger
DOCKER_IMAGE := hollandandbarrett/k8s-deploy:2.36
help:
@printf "Usage: make [target] [VARIABLE=value]\nTargets:\n"
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
bootstrap: ## Install pre-commit hooks
@pre-commit install
@pre-commit gc
uninstall: ## Uninstall hooks
@pre-commit uninstall
validate: ## Validate files with pre-commit hooks
@pre-commit run --all-files
install: ## Install dependencies
@npm install
local: ## Run locally
@yarn danger pr --dangerfile dangerfile.js $(DANGER_PR_URL)
open-mr: ## Run locally and open mr --id $(shell uuid)
@yarn danger ci --removePreviousComments
docker-build: ## Docker image build
@docker build . --tag $(DOCKER_LOCAL) -f Dockerfile --progress plain
docker-exec-local: ## Docker exec to an image build locally
@docker run -it --rm $(DOCKER_LOCAL)
test: ## Run tests
@yarn run test
run: ## Run Docker locally
docker run --rm -it \
-e DANGER_GITLAB_API_TOKEN \
-e DANGER_GITLAB_TEAM \
-e DANGER_GITLAB_HOST \
-e DANGER_PR_URL \
-e DANGER_TEST_PR \
-w /workspace \
-v ${PWD}/dangerfile.js:/workspace/dangerfile.js \
$(DOCKER_LOCAL)
run-remote: ## Docker exec to an image
@docker run --rm -it $(DOCKER_IMAGE)