2014-03-18 19:26:01 +00:00
|
|
|
tag = $(shell git describe)
|
2014-04-24 21:47:46 +00:00
|
|
|
export_name = phpservermon-$(tag)
|
2014-03-18 19:26:01 +00:00
|
|
|
|
|
|
|
help:
|
2014-08-05 07:51:09 +00:00
|
|
|
@echo ' PHP Server Monitor - $(tag) '
|
|
|
|
@echo ' - make export [tag=...] - create a new release from tag '
|
|
|
|
@echo ' - make install - install all dependencies '
|
|
|
|
|
|
|
|
install:
|
|
|
|
@echo 'Downloading dependencies using Composer'
|
|
|
|
php composer.phar install
|
|
|
|
@echo 'Install complete '
|
2014-03-18 19:26:01 +00:00
|
|
|
|
|
|
|
export:
|
|
|
|
@echo 'Building release for tag $(tag) '
|
2014-04-24 21:47:46 +00:00
|
|
|
mkdir -p ./build ./build/$(export_name)
|
|
|
|
rm -rf ./build/$(export_name)/*
|
|
|
|
git archive $(tag) | tar -xf - -C ./build/$(export_name)/
|
|
|
|
find ./build/$(export_name) -name "*.php" -exec sed -i "" "s/@package_version@/$(tag)/" {} \;
|
2014-04-06 14:52:58 +00:00
|
|
|
@echo 'Testing on syntax errors (thats all the automated testing your are going to get for now..) '
|
2014-04-24 21:47:46 +00:00
|
|
|
find ./build/$(export_name) -name "*.php" | xargs -I file php -l file
|
2014-04-24 21:31:48 +00:00
|
|
|
@echo 'Downloading dependencies'
|
2014-04-24 21:47:46 +00:00
|
|
|
cd ./build/$(export_name); php composer.phar install; cd ../../;
|
|
|
|
rm -f ./build/$(export_name)/composer.phar
|
|
|
|
rm -f ./build/$(export_name)/composer.json
|
|
|
|
rm -f ./build/$(export_name)/composer.lock
|
2014-04-10 16:29:53 +00:00
|
|
|
@echo 'Building HTML documentation'
|
2014-04-24 21:47:46 +00:00
|
|
|
cd ./build/$(export_name)/docs; make BUILDDIR=. html; cd ../../../;
|
2014-04-10 16:29:53 +00:00
|
|
|
@echo 'Cleaning up docs dir'
|
2014-04-24 21:47:46 +00:00
|
|
|
rm -f ./build/$(export_name)/Makefile
|
|
|
|
rm -f ./build/$(export_name)/docs/Makefile
|
|
|
|
rm -f ./build/$(export_name)/docs/make.bat
|
|
|
|
rm -f ./build/$(export_name)/docs/conf.py
|
2014-04-10 16:29:53 +00:00
|
|
|
@echo 'Setting folder and file permissions'
|
2014-04-24 21:47:46 +00:00
|
|
|
find ./build/$(export_name) -type f | xargs chmod 0644
|
|
|
|
find ./build/$(export_name) -type d | xargs chmod 0755
|
2014-04-10 16:29:53 +00:00
|
|
|
@echo 'Creating archives'
|
2014-04-24 21:47:46 +00:00
|
|
|
cd ./build; zip -rq $(export_name).zip ./$(export_name); cd ../;
|
|
|
|
cd ./build; tar -pczf $(export_name).tar.gz ./$(export_name); cd ../;
|
|
|
|
#rm -rf ./build/$(export_name)
|
2014-03-18 19:26:01 +00:00
|
|
|
@echo 'Building release finished '
|