diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2017-11-01 13:22:38 +0100 |
---|---|---|
committer | Kevin Decherf <kevin@kdecherf.com> | 2017-11-19 12:33:21 +0100 |
commit | 8bde7de1ee4b6944e3f3d3024ed619ac5980be27 (patch) | |
tree | 18de38922cb46d36ba245a1fc006c28449571edc /Makefile | |
parent | c20327fc723863ca985ac36a4eacec1699d57a31 (diff) | |
download | wallabag-8bde7de1ee4b6944e3f3d3024ed619ac5980be27.tar.gz wallabag-8bde7de1ee4b6944e3f3d3024ed619ac5980be27.tar.zst wallabag-8bde7de1ee4b6944e3f3d3024ed619ac5980be27.zip |
Replace ant with Makefile
Fixes #1735
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
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 |