-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
97 lines (78 loc) · 2.06 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
all: updatecode depcheck updatedb success
depcheck:
php depcheck.php
success:
@echo "[*** SUCCESS ***] Installation and upgrade of Startup API completed successfully"
updatecode:
ifneq "$(wildcard .git )" ""
git submodule init
git submodule update
endif
checkconfig:
ifeq ($(wildcard ../users_config.php),)
$(error "Can't find ../users_config.php in parent folder. Create it first by copying users_config.sample.php and edit it")
else
@echo Found configuration file ../users_config.php
endif
db: updatedb
updatedb: checkconfig
php dbupgrade.php
php aggregatepoints.php
rel: release
release: releasetag packages
releasetag:
ifndef v
#
# make rel v=1.1.1
#
$(error You must specify version number in 'v' parameter: make release v=1.1.1)
else
#
# Tagging it with release tag
#
git tag -a REL_${subst .,_,${v}}
git push --tags
endif
packages:
ifndef v
#
# make packages v=1.1.1
#
$(error You must specify version number in 'v' parameter: make packages v=1.1.1)
else
mkdir StartupAPI_${v}
# generate the package
git clone . StartupAPI_${v}/users
cd StartupAPI_${v}/users/ && git checkout REL_${subst .,_,${v}}
cd StartupAPI_${v}/users/ && ${MAKE} updatecode
cd StartupAPI_${v}/users/ && find ./ -name "\.git*" | xargs -n10 rm -r
tar -c StartupAPI_${v}/ |bzip2 > StartupAPI_${v}.tar.bz2
zip -r StartupAPI_${v}.zip StartupAPI_${v}
rm -rf StartupAPI_${v}
echo "Upload files to GitHub: https://github.com/StartupAPI/users/releases/new?tag=REL_${subst .,_,${v}}"
endif
docs: documentation
documentation: phpdoc apigen
phpdoc:
# Using PHPDocumentor which wirks with phpdocx.dist.xml
phpdoc
apigen:
# Using ApiGen which works with apigen.neon file for configuration
apigen
code:
php phptidy/phptidy.php replace
find . -name '*.phptidybak~' | xargs -n10 rm
test: cleantest runtests
runtests:
mkdir -p tests/run
npm install
nohup phantomjs --webdriver=4444 &
sleep 1
-node tests/test.js http://howdoable.lc/users tests/run
-killall phantomjs
open tests/run/*.png
cleantest:
rm -rf tests/run/
rm -f nohup.out
distclean: cleantest
rm -rf node_modules/