]> git.immae.eu Git - github/wallabag/wallabag.git/blame - GNUmakefile
Ensure ENV is well defined when using make
[github/wallabag/wallabag.git] / GNUmakefile
CommitLineData
681e04b0
OM
1SHELL=bash
2TMP_FOLDER=/tmp
3RELEASE_FOLDER=wllbg-release
4
49eb5405
JB
5# ensure the ENV variable is well defined
6ifeq ($(origin ENV), prod)
7 # all good ("prod" is a valid env)
8else ifeq ($(origin ENV), dev)
9 # all good ("dev" is a valid env)
10else ifeq ($(origin ENV), test)
11 # all good ("test" is a valid env)
12else
13 # not good, force it to "prod"
14 override ENV = prod
15endif
681e04b0
OM
16
17help: ## 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
20clean: ## Clear the application cache
21 rm -rf var/cache/*
22
7a4c375e 23install: customcss ## Install wallabag with the latest version
681e04b0
OM
24 @./scripts/install.sh $(ENV)
25
26update: ## Update the wallabag installation to the latest version
27 @./scripts/update.sh $(ENV)
28
b1574a39 29dev: ENV=dev
7a4c375e 30dev: build customcss ## Install the latest dev version
681e04b0
OM
31 @./scripts/dev.sh
32
33run: ## Run the wallabag built-in server
34 @php bin/console server:run --env=dev
35
36build: ## Run webpack
b1574a39 37 @npm install
681e04b0
OM
38 @npm run build:$(ENV)
39
7a4c375e
LD
40customcss:
41 @touch web/custom.css
42
681e04b0
OM
43prepare: clean ## Prepare database for testsuite
44ifdef DB
45 cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
46endif
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
51fixtures: ## Load fixtures into database
52 php bin/console doctrine:fixtures:load --no-interaction --env=test
53
54test: prepare fixtures ## Launch wallabag testsuite
55 bin/simple-phpunit -v
56
57release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
58ifndef VERSION
59 $(error VERSION is not set)
60endif
61 @./scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
62
63deploy: ## 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