Skip to content

Commit

Permalink
Makefile sugar
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Donat committed May 12, 2014
1 parent 34491ac commit d0feda9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ build/log
build/docs
build/dist
tmp
package.xml
1 change: 0 additions & 1 deletion .sami.php
Expand Up @@ -12,7 +12,6 @@

$versions = GitVersionCollection::create($dir)
->addFromTags('*')
->add('master', 'master')
;

return new Sami($iterator, array(
Expand Down
51 changes: 47 additions & 4 deletions Makefile
@@ -1,4 +1,7 @@
.PHONY: cs md cov pear
.PHONY: cs md cov pear docs check

PHP_VFS_BUILD_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
PHP_VFS_BUILD_REV=$(shell git rev-parse HEAD)

cs:
phpcs --standard=PSR2 src/
Expand All @@ -13,9 +16,49 @@ cov:
vendor/bin/phpunit --coverage-html=build/log/coverage
open build/log/coverage/index.html

pear:
ifndef version
check:
$(error Usage: make tag version=...)
else
check:
@git diff --quiet HEAD || (echo WORKING DIRECTORY DIRTY && false)
endif

setup-pear:
git remote add pear git@github.com:thornag/pear.git || true
git fetch pear
git checkout pear || git checkout -b pear pear/gh-pages
git checkout -
sudo pear channel-discover pear.michaeldonat.net || true
mkdir -p build/dist

pear: check setup-pear
./build/pear/package.php --source=src/ --version=$(version) > package.xml
pear package
mv VirtualFileSystem-$(version).tgz build/dist/
/usr/local/opt/php55/bin/pirum add ../pear.thornag.github.io build/dist/VirtualFileSystem-$(version).tgz
cd ../pear.thornag.github.io && git add . && git commit -a -m'adding VirtualFileSystem-$(version).tgz' && git push
git checkout pear
/usr/local/opt/php55/bin/pirum add . build/dist/VirtualFileSystem-$(version).tgz
git add . && git commit -a -m'adding VirtualFileSystem-$(version).tgz' && git push pear pear:gh-pages
git checkout -f -

docs:
@git diff --quiet HEAD || (echo WORKING DIRECTORY DIRTY && false)
./vendor/bin/sami.php update .sami.php
vendor/bin/phpunit --coverage-html=build/log/coverage
git checkout gh-pages
git pull
mkdir -p api
cp -rf build/docs/api/* api/
git add api
mkdir -p coverage
cp -rf build/log/coverage/* coverage/
git add coverage
git commit -m"auto-generated coverage & API docs for $(PHP_VFS_BUILD_BRANCH):$(PHP_VFS_BUILD_REV)" || true
git push
git checkout $(PHP_VFS_BUILD_BRANCH)

tag: check
git tag v$(version)
git push --tags

deploy: tag pear docs
84 changes: 0 additions & 84 deletions package.xml

This file was deleted.

0 comments on commit d0feda9

Please sign in to comment.