Permalink
Fetching contributors…
Cannot retrieve contributors at this time
98 lines (78 sloc) 2.06 KB
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/