aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-11-21 15:12:48 +0100
committerGitHub <noreply@github.com>2017-11-21 15:12:48 +0100
commitd3d0defabc8224172b59c85db66c2d4e6bc3f06b (patch)
treea69dcb337eac10969ea5ace6f950a920faf2a142
parent95b7d92ea5f92078c2e1fed0b346a9722de762c4 (diff)
parent8bde7de1ee4b6944e3f3d3024ed619ac5980be27 (diff)
downloadwallabag-d3d0defabc8224172b59c85db66c2d4e6bc3f06b.tar.gz
wallabag-d3d0defabc8224172b59c85db66c2d4e6bc3f06b.tar.zst
wallabag-d3d0defabc8224172b59c85db66c2d4e6bc3f06b.zip
Merge pull request #3398 from wallabag/issue-1735
Replace ant with Makefile
-rw-r--r--.travis.yml2
-rwxr-xr-xMakefile36
-rw-r--r--build.xml136
3 files changed, 28 insertions, 146 deletions
diff --git a/.travis.yml b/.travis.yml
index 6b279ed6..42fbb966 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -70,7 +70,7 @@ before_install:
70 70
71script: 71script:
72 - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist 72 - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist
73 - ant prepare-$DB 73 - make prepare DB=$DB
74 74
75 - echo "travis_fold:start:migrations" 75 - echo "travis_fold:start:migrations"
76 - php bin/console doctrine:migrations:migrate --no-interaction --env=test 76 - php bin/console doctrine:migrations:migrate --no-interaction --env=test
diff --git a/Makefile b/Makefile
index ffbe102a..9e44edc6 100755
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,13 @@
1TMP_FOLDER=/tmp 1TMP_FOLDER=/tmp
2RELEASE_FOLDER=wllbg-release 2RELEASE_FOLDER=wllbg-release
3 3
4ifndef ENV 4ENV ?= prod
5 ENV=prod
6endif
7 5
8help: ## Display this help menu 6help: ## 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
11clean: ## Clear the application cache 9clean: ## Clear the application cache
12 @rm -rf var/cache/* 10 rm -rf var/cache/*
13 11
14install: ## Install wallabag with the latest version 12install: ## 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
26build: ## Run webpack 24build: ## Run webpack
27 @npm run build:$(ENV) 25 @npm run build:$(ENV)
28 26
29test: ## Launch wallabag testsuite 27prepare: clean ## Prepare database for testsuite
30 @ant prepare && bin/simple-phpunit -v 28ifdef DB
29 cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
30endif
31 -php bin/console doctrine:database:drop --force --env=test
32 php bin/console doctrine:database:create --env=test
33ifndef DB ## make test does not define DB
34 php bin/console doctrine:schema:create --env=test
35endif
36ifeq ($(DB), sqlite)
37 php bin/console doctrine:schema:create --env=test
38endif
39ifeq ($(DB), mysql)
40 php bin/console doctrine:database:import data/sql/mysql_base.sql --env=test
41endif
42ifeq ($(DB), pgsql)
43 psql -h localhost -d wallabag_test -U travis -f data/sql/pgsql_base.sql
44endif
45
46fixtures: ## Load fixtures into database
47 php bin/console doctrine:fixtures:load --no-interaction --env=test
48
49test: prepare fixtures ## Launch wallabag testsuite
50 bin/simple-phpunit -v
31 51
32release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`). 52release: ## Create a package. Need a VERSION parameter (eg: `make release VERSION=master`).
33ifndef VERSION 53ifndef VERSION
@@ -35,11 +55,9 @@ ifndef VERSION
35endif 55endif
36 @sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV) 56 @sh scripts/release.sh $(VERSION) $(TMP_FOLDER) $(RELEASE_FOLDER) $(ENV)
37 57
38travis: ## Make some stuff for Travis-CI
39
40deploy: ## Deploy wallabag 58deploy: ## 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
diff --git a/build.xml b/build.xml
deleted file mode 100644
index b9fe6136..00000000
--- a/build.xml
+++ /dev/null
@@ -1,136 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<project name="wallabag" default="build">
3 <target name="build" depends="clean,prepare,phpunit"/>
4 <target name="prepare-mysql" depends="clean,prepare_mysql"/>
5 <target name="prepare-sqlite" depends="clean,prepare_sqlite"/>
6 <target name="prepare-pgsql" depends="clean,prepare_pgsql"/>
7
8 <target name="clean" description="Cleanup build artifacts">
9 <delete dir="${basedir}/var/cache"/>
10 </target>
11
12 <target name="prepare" description="Prepare for build">
13 <exec executable="php">
14 <arg value="${basedir}/bin/console"/>
15 <arg value="doctrine:database:drop"/>
16 <arg value="--force"/>
17 <arg value="--env=test"/>
18 </exec>
19 <exec executable="php">
20 <arg value="${basedir}/bin/console"/>
21 <arg value="doctrine:database:create"/>
22 <arg value="--env=test"/>
23 </exec>
24 <exec executable="php">
25 <arg value="${basedir}/bin/console"/>
26 <arg value="doctrine:schema:create"/>
27 <arg value="--env=test"/>
28 </exec>
29 <exec executable="php">
30 <arg value="${basedir}/bin/console"/>
31 <arg value="doctrine:fixtures:load"/>
32 <arg value="--no-interaction"/>
33 <arg value="--env=test"/>
34 </exec>
35 </target>
36
37 <target name="prepare_mysql" description="Run test for MySQL">
38 <delete dir="${basedir}/app/config/parameters.yml"/>
39 <exec executable="cp">
40 <arg value="${basedir}/app/config/tests/parameters_test.mysql.yml"/>
41 <arg value="${basedir}/app/config/parameters_test.yml"/>
42 </exec>
43 <exec executable="php">
44 <arg value="${basedir}/bin/console"/>
45 <arg value="cache:clear"/>
46 <arg value="--env=test"/>
47 </exec>
48 <exec executable="php">
49 <arg value="${basedir}/bin/console"/>
50 <arg value="doctrine:database:drop"/>
51 <arg value="--force"/>
52 <arg value="--env=test"/>
53 </exec>
54 <exec executable="php">
55 <arg value="${basedir}/bin/console"/>
56 <arg value="doctrine:database:create"/>
57 <arg value="--env=test"/>
58 </exec>
59 <exec executable="php">
60 <arg value="${basedir}/bin/console"/>
61 <arg value="doctrine:database:import"/>
62 <arg value="data/sql/mysql_base.sql"/>
63 <arg value="--env=test"/>
64 </exec>
65 </target>
66
67 <target name="prepare_sqlite" description="Run test for SQLite">
68 <delete dir="${basedir}/app/config/parameters.yml"/>
69 <exec executable="cp">
70 <arg value="${basedir}/app/config/tests/parameters_test.sqlite.yml"/>
71 <arg value="${basedir}/app/config/parameters_test.yml"/>
72 </exec>
73 <exec executable="php">
74 <arg value="${basedir}/bin/console"/>
75 <arg value="cache:clear"/>
76 <arg value="--env=test"/>
77 </exec>
78 <exec executable="php">
79 <arg value="${basedir}/bin/console"/>
80 <arg value="doctrine:database:drop"/>
81 <arg value="--force"/>
82 <arg value="--env=test"/>
83 </exec>
84 <exec executable="php">
85 <arg value="${basedir}/bin/console"/>
86 <arg value="doctrine:database:create"/>
87 <arg value="--env=test"/>
88 </exec>
89 <exec executable="php">
90 <arg value="${basedir}/bin/console"/>
91 <arg value="doctrine:schema:create"/>
92 <arg value="--env=test"/>
93 </exec>
94 </target>
95
96 <target name="prepare_pgsql" description="Run test for PostgreSQL">
97 <delete dir="${basedir}/app/config/parameters.yml"/>
98 <exec executable="cp">
99 <arg value="${basedir}/app/config/tests/parameters_test.pgsql.yml"/>
100 <arg value="${basedir}/app/config/parameters_test.yml"/>
101 </exec>
102 <exec executable="php">
103 <arg value="${basedir}/bin/console"/>
104 <arg value="cache:clear"/>
105 <arg value="--env=test"/>
106 </exec>
107 <exec executable="php">
108 <arg value="${basedir}/bin/console"/>
109 <arg value="doctrine:database:drop"/>
110 <arg value="--force"/>
111 <arg value="--env=test"/>
112 </exec>
113 <exec executable="php">
114 <arg value="${basedir}/bin/console"/>
115 <arg value="doctrine:database:create"/>
116 <arg value="--env=test"/>
117 </exec>
118 <exec executable="psql">
119 <arg value="-h"/>
120 <arg value="localhost"/>
121 <arg value="-d"/>
122 <arg value="wallabag_test"/>
123 <arg value="-U"/>
124 <arg value="travis"/>
125 <arg value="-f"/>
126 <arg value="data/sql/pgsql_base.sql"/>
127 </exec>
128 </target>
129
130 <target name="phpunit" description="Run unit tests with PHPUnit + HTML Coverage">
131 <exec executable="phpunit" failonerror="true">
132 <arg value="--coverage-html"/>
133 <arg value="build/coverage"/>
134 </exec>
135 </target>
136</project>