Skip to content

Commit f14ff5f

Browse files
committed
Added ApiGen
1 parent 359f7cf commit f14ff5f

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Diff for: .travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ before_script:
1717
- composer install --no-interaction --prefer-source
1818

1919
script:
20-
- phpunit
20+
- phpunit
21+
22+
after_success:
23+
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then sh generate-api.sh; fi

Diff for: generate-api.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Get ApiGen.phar
2+
wget http://www.apigen.org/apigen.phar
3+
4+
# Generate Api
5+
php apigen.phar generate -s src -d ../gh-pages
6+
cd ../gh-pages
7+
8+
# Set identity
9+
git config --global user.email "[email protected]"
10+
git config --global user.name "Travis"
11+
12+
# Add branch
13+
git init
14+
git remote add origin https://${GH_TOKEN}@github.com/dfridrich/QRPlatba.git > /dev/null
15+
git checkout -B gh-pages
16+
17+
# Push generated files
18+
git add .
19+
git commit -m "API updated"
20+
git push origin gh-pages -fq > /dev/null

0 commit comments

Comments
 (0)