generated from ik-workshop/workshop-blueprint
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (56 loc) · 1.93 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SHELL = /bin/sh -o pipefail
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
CI_RENOVATE_IMAGE := renovate/renovate:31.72-slim
LOG_LEVEL := debug
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
setup: ## Setup dependencies
@brew bundle
hooks: ## install pre commit.
@pre-commit install
@pre-commit gc
@pre-commit autoupdate
validate: ## Validate files with pre-commit hooks
@pre-commit run --all-files
run: check-cmd
run: ## Run renovate locally name=ex5
@docker run --rm -it \
-e RENOVATE_TOKEN \
-e DOCKER_HUB_USERNAME \
-e DOCKER_HUB_TOKEN \
-e LOG_LEVEL=$(LOG_LEVEL) \
-e EXCERCISE_NAME=$(name) \
-v ${PWD}/.cache:/tmp/renovate \
-v ${PWD}/playground/$(name)/config.js:/usr/src/app/config.js \
-v ${PWD}/config/repos.json:/usr/src/app/repos.json \
-v ${PWD}/playground/$(name)/regexManagers.js:/usr/src/app/regexManagers.js \
-v ${PWD}/playground/$(name)/packageRules.js:/usr/src/app/packageRules.js \
$(CI_RENOVATE_IMAGE) renovate --dry-run=false
check-cmd:
ifndef name
$(error The name variable is not set)
endif
ifneq ($(findstring ex,$(name)),ex)
$(error The name variable does not contain 'ex')
endif
skeleton: ## Render exercise skeleto from templates locally and create them in sandbox foler.
skeleton: check-cmd
@mkdir playground/$(name)
@cp -r playground/template/ playground/$(name)/
@tree playground/$(name)
@mkdir sandbox/$(name)
@touch sandbox/$(name)/.gitkeep
@touch exercises/$(name).README.md
@echo "# Exercise $(name). TODO(description) \n\n<!-- START doctoc -->\n<!-- END doctoc --> \n\n## Resources" >> exercises/$(name).README.md
run2: ## Run exercise 2
@echo "Run Exercise 2"
@$(MAKE) run name=ex2
run5: ## Run exercise 5
@echo "Run Exercise 5"
@$(MAKE) run name=ex5
run6: ## Run exercise 6
@echo "Run Exercise 6"
@$(MAKE) run name=ex6