diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-11-21 15:12:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 15:12:48 +0100 |
commit | d3d0defabc8224172b59c85db66c2d4e6bc3f06b (patch) | |
tree | a69dcb337eac10969ea5ace6f950a920faf2a142 /Makefile | |
parent | 95b7d92ea5f92078c2e1fed0b346a9722de762c4 (diff) | |
parent | 8bde7de1ee4b6944e3f3d3024ed619ac5980be27 (diff) | |
download | wallabag-d3d0defabc8224172b59c85db66c2d4e6bc3f06b.tar.gz wallabag-d3d0defabc8224172b59c85db66c2d4e6bc3f06b.tar.zst wallabag-d3d0defabc8224172b59c85db66c2d4e6bc3f06b.zip |
Merge pull request #3398 from wallabag/issue-1735
Replace ant with Makefile
Diffstat (limited to 'Makefile')
-rwxr-xr-x | Makefile | 36 |
1 files changed, 27 insertions, 9 deletions
@@ -1,15 +1,13 @@ | |||
1 | TMP_FOLDER=/tmp | 1 | TMP_FOLDER=/tmp |
2 | RELEASE_FOLDER=wllbg-release | 2 | RELEASE_FOLDER=wllbg-release |
3 | 3 | ||
4 | ifndef ENV | 4 | ENV ?= prod |
5 | ENV=prod | ||
6 | endif | ||
7 | 5 | ||
8 | help: ## Display this help menu | 6 | help: ## Display this help menu |
9 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | 7 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' |
10 | 8 | ||
11 | clean: ## Clear the application cache | 9 | clean: ## Clear the application cache |
12 | @rm -rf var/cache/* | 10 | rm -rf var/cache/* |
13 | 11 | ||
14 | install: ## Install wallabag with the latest version | 12 | install: ## Install wallabag with the latest version |
15 | @sh scripts/install.sh $(ENV) | 13 | @sh scripts/install.sh $(ENV) |
@@ -26,8 +24,30 @@ run: ## Run the wallabag built-in server | |||
26 | build: ## Run webpack | 24 | build: ## Run webpack |
27 | @npm run build:$(ENV) | 25 | @npm run build:$(ENV) |
28 | 26 | ||
29 | test: ## Launch wallabag testsuite | 27 | prepare: clean ## Prepare database for testsuite |
30 | @ant prepare && bin/simple-phpunit -v | 28 | ifdef DB |
29 | cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml | ||
30 | endif | ||
31 | -php bin/console doctrine:database:drop --force --env=test | ||
32 | php bin/console doctrine:database:create --env=test | ||
33 | ifndef DB ## make test does not define DB | ||
34 | php bin/console doctrine:schema:create --env=test | ||
35 | endif | ||
36 | ifeq ($(DB), sqlite) | ||
37 | php bin/console doctrine:schema:create --env=test | ||
38 | endif | ||
39 | ifeq ($(DB), mysql) | ||
40 | php bin/console doctrine:database:import data/sql/mysql_base.sql --env=test | ||
41 | endif | ||
42 | ifeq ($(DB), pgsql) | ||
43 | psql -h localhost -d wallabag_test -U travis -f data/sql/pgsql_base.sql | ||
44 | endif | ||
45 | |||
46 | fixtures: ## Load fixtures into database | ||
47 | php bin/console doctrine:fixtures:load --no-interaction --env=test | ||
48 | |||
49 | test: prepare fixtures ## Launch wallabag testsuite | ||
50 | bin/simple-phpunit -v | ||
31 | 51 | ||
32 | release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). | 52 | release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). |
33 | ifndef VERSION | 53 | ifndef VERSION |
@@ -35,11 +55,9 @@ ifndef VERSION | |||
35 | endif | 55 | endif |
36 | @sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV) | 56 | @sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV) |
37 | 57 | ||
38 | travis: ## Make some stuff for Travis-CI | ||
39 | |||
40 | deploy: ## Deploy wallabag | 58 | deploy: ## Deploy wallabag |
41 | @bundle exec cap staging deploy | 59 | @bundle exec cap staging deploy |
42 | 60 | ||
43 | .PHONY: help clean install update build test release travis deploy run dev | 61 | .PHONY: help clean prepare install fixtures update build test release deploy run dev |
44 | 62 | ||
45 | .DEFAULT_GOAL := install | 63 | .DEFAULT_GOAL := install |