1
1
#! /bin/sh
2
2
# please set the $GH_TOKEN in your travis dashboard
3
3
4
- if [ " $TRAVIS_BRANCH " = " master " ] || [ " $TRAVIS_BRANCH " = " develop" ] && [ " $TRAVIS_REPO_SLUG " = " glpi-project/php-library-glpi " ]; then
4
+ if [ " $TRAVIS_BRANCH " = " develop" ] && [ " $TRAVIS_PULL_REQUEST " = false ]; then
5
5
wget http://get.sensiolabs.org/sami.phar -O " $HOME /bin/sami.phar"
6
6
# setup_git only for the main repo and not forks
7
+ echo " Configuring git user"
7
8
git config --global user.email " deploy@travis-ci.org"
8
9
git config --global user.name " Deployment Bot"
10
+ echo " adding and fetch a new remote"
9
11
git remote add upstream https://" $GH_TOKEN " @github.com/" $TRAVIS_REPO_SLUG " .git > /dev/null 2>&1
10
12
git fetch upstream
11
13
12
14
if [ " $TRAVIS_BRANCH " = " develop" ]; then
15
+ echo " generating the release"
13
16
git stash save -u
14
17
vendor/bin/robo publish:release " $TRAVIS_REPO_SLUG " none upstream
15
18
git checkout " $TRAVIS_BRANCH "
@@ -18,6 +21,7 @@ if [ "$TRAVIS_BRANCH" = "master" ] || [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TR
18
21
19
22
# check if gh-pages exist in remote
20
23
if [ " git branch -r --list upstream/gh-pages" ]; then
24
+ echo " generating the docs"
21
25
# clean the repo and generate the docs
22
26
git checkout composer.lock
23
27
php $HOME /bin/sami.phar update " $TRAVIS_BUILD_DIR " /.github/samiConfig.php --force
@@ -26,15 +30,18 @@ if [ "$TRAVIS_BRANCH" = "master" ] || [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TR
26
30
find build/tests/coverage/ -type f -name " *.html" -exec sed -i " /report.css/d" " {}" \;
27
31
28
32
# commit_website_files
33
+ echo " adding the reports"
29
34
git add build/tests/coverage/*
30
35
git add build/docs/*
36
+ echo " creating a branch for the new documents"
31
37
git checkout -b localCi
32
38
git commit -m " changes to be merged"
33
39
git checkout -b gh-pages upstream/gh-pages
34
40
git checkout localCi build/
35
41
36
42
# upload_files
37
- git commit --message " docs(*): update code coverage and test result"
43
+ echo " pushing the up to date documents"
44
+ git commit --message " docs: update tests reports"
38
45
git rebase upstream/gh-pages
39
46
git push --quiet --set-upstream upstream gh-pages --force
40
47
fi
0 commit comments