]> git.immae.eu Git - github/wallabag/wallabag.git/blob - GNUmakefile
Ensure ENV is well defined when using make
[github/wallabag/wallabag.git] / GNUmakefile
1 SHELL=bash
2 TMP_FOLDER=/tmp
3 RELEASE_FOLDER=wllbg-release
4
5 # ensure the ENV variable is well defined
6 ifeq ($(origin ENV), prod)
7 # all good ("prod" is a valid env)
8 else ifeq ($(origin ENV), dev)
9 # all good ("dev" is a valid env)
10 else ifeq ($(origin ENV), test)
11 # all good ("test" is a valid env)
12 else
13 # not good, force it to "prod"
14 override ENV = prod
15 endif
16
17 help: ## Display this help menu
18 @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
19
20 clean: ## Clear the application cache
21 rm -rf var/cache/*
22
23 install: customcss ## Install wallabag with the latest version
24 @./scripts/install.sh $(ENV)
25
26 update: ## Update the wallabag installation to the latest version
27 @./scripts/update.sh $(ENV)
28
29 dev: ENV=dev
30 dev: build customcss ## Install the latest dev version
31 @./scripts/dev.sh
32
33 run: ## Run the wallabag built-in server
34 @php bin/console server:run --env=dev
35
36 build: ## Run webpack
37 @npm install
38 @npm run build:$(ENV)
39
40 customcss:
41 @touch web/custom.css
42
43 prepare: clean ## Prepare database for testsuite
44 ifdef DB
45 cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
46 endif
47 -php bin/console doctrine:database:drop --force --env=test
48 php bin/console doctrine:database:create --env=test
49 php bin/console doctrine:migrations:migrate --no-interaction --env=test
50
51 fixtures: ## Load fixtures into database
52 php bin/console doctrine:fixtures:load --no-interaction --env=test
53
54 test: prepare fixtures ## Launch wallabag testsuite
55 bin/simple-phpunit -v
56
57 release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
58 ifndef VERSION
59 $(error VERSION is not set)
60 endif
61 @./scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
62
63 deploy: ## Deploy wallabag
64 @bundle exec cap staging deploy
65
66 .PHONY: help clean prepare install fixtures update build test release deploy run dev
67
68 .DEFAULT_GOAL := install