xref: /conch/Makefile (revision e98c5f00)
1.PHONY: test run morbo build clean format deps install-deps generate-dbic watch-perl\
2	watch doc migrate-db watch-test
3
4run: build morbo ## Default. Build and run under morbo
5
6morbo: ## Run under morbo, listening on :5001
7	@carton exec -- morbo -v bin/conch -l http://\*:5001
8
9build: local ## Install deps (TODO: and build docs)
10
11clean:
12	\rm -rf local log
13
14local: cpanfile.snapshot ## Install perl dependencies
15# '--deployment' installs the same dep versions that are in the lockfile
16	@carton install --deployment && touch local
17
18.PHONY: forcebuild
19forcebuild: ## Always run carton
20	carton install --deployment
21
22test: local ## Run tests
23	@carton exec prove -lpr t/
24
25test_loud: local ## Run tests but tell the Mojo harness to log verbosely to log/
26	MOJO_LOG_LEVEL=debug carton exec prove -lpr t/
27
28.PHONY: ghdocs
29ghdocs: build
30	@rm -rf docs/modules
31	@mkdir -p docs/modules
32	@carton exec misc/pod2githubpages $$(find lib -type f -iname \*.pm)
33
34watch-test:
35	@find lib t | entr -r -c make test
36
37generate-dbic: dbic
38
39.PHONY: dbic
40dbic: ## Regenerate DBIC schemas
41	@carton exec dbicdump -Ilib schema-loader.yaml
42	@make db-schema
43
44migrate-db: ## Apply database migrations
45	@sql/run_migrations.sh
46	@make db-schema
47
48.PHONY: db-schema
49db-schema: ## create a dump of current db schema
50	pg_dump --username conch --schema-only --file sql/schema.sql conch
51
52docker_test:
53	@echo "============================"
54	@echo "This so very experimental."
55	@echo "============================"
56	@echo "============================"
57	bash docker/dev_test.bash
58
59.PHONY: help
60help: ## Display this help message
61	@echo "GNU make(1) targets:"
62	@grep -E '^[a-zA-Z_.-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
63
64