-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (78 loc) · 2.73 KB
/
Makefile
File metadata and controls
93 lines (78 loc) · 2.73 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
########
# Help #
########
## Colors
COLOR_RESET = \033[0m
COLOR_INFO = \033[32m
COLOR_COMMENT = \033[33m
## Suggested run order (edit to taste)
SUGGESTED_TARGETS = \
drupal-install \
storybook-install \
generate-stories \
storybook-build \
storybook
.DEFAULT_GOAL := help
.PHONY: help
help: ## Display this help message
@printf "${COLOR_COMMENT}Usage:${COLOR_RESET}\n"
@printf " make [target]\n\n"
@printf "${COLOR_COMMENT}Suggested order on initial creation:${COLOR_RESET}\n"
@for t in $(SUGGESTED_TARGETS); do \
desc=$$(grep -E "^$$t:.*## " $(MAKEFILE_LIST) | sed -E 's/^[^#]+## (.*)$$/\1/'); \
if [ -n "$$desc" ]; then \
printf " ${COLOR_INFO}%-30s${COLOR_RESET} %s\n" "$$t" "$$desc"; \
else \
printf " ${COLOR_INFO}%-30s${COLOR_RESET}\n" "$$t"; \
fi; \
done
@printf "\n${COLOR_COMMENT}Available targets:${COLOR_RESET}\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; { \
printf " ${COLOR_INFO}%-30s${COLOR_RESET} %s\n", $$1, $$2 \
}'
.PHONY: storybook
storybook: ## Run storybook from inside DDEV.
ddev exec "cd tests && npm run storybook"
.PHONY: storybook-build
storybook-build: ## Build storybook from inside DDEV.
ddev exec "cd tests && npm run build-storybook"
.PHONY: storybook-install
storybook-install: ## Install storybook inside DDEV.
ddev exec "cd tests && npm install"
.PHONY: generate-stories
generate-stories: ## Generate all stories.
ddev drush storybook:generate-all-stories --uri=https://drupal-storybook.ddev.site/
.PHONY: launch-storybook-static
launch-storybook-static: ## Launch the storybook static site.
ddev launch /storybook-static
.PHONY: clear-generated-stories
clear-generated-stories: ## Clear all generated stories.
ddev exec "rm -rf ./web/themes/custom/my_theme/components/*/*.stories.json"
.PHONY: drupal-install
drupal-install: ## Install Drupal using built in config.
ddev drush sql-drop --yes
ddev drush si --existing-config --yes --account-name=admin --account-pass=admin
ddev drush cr
ddev drush cim -y
.PHONY: drupal-setup
drupal-setup: ## Set up Drupal for Twig development.
ddev drush state:set twig_debug 1
ddev drush state:set twig_cache_disable 1
ddev drush state:set disable_rendered_output_cache_bins 1
.PHONY: composer-install
composer-install: ## Install composer dependencies.
ddev composer install
.PHONY: install-all
install-all: composer-install drupal-install drupal-setup storybook-install ## Install everything.
.PHONY: clear
clear: ## Clear the codebase of installed files.
rm -rf ./tests/node_modules
rm -rf ./tests/storybook-static
rm -rf ./vendor
rm -rf ./web/core
rm -rf ./web/modules/contrib
rm -rf ./web/theme/contrib
rm -rf ./web/index.php
rm -rf ./web/update.php
rm -rf ./web/autoload.php
rm -rf ./web/robots.txt