message: Reworks geli-doc git pushing
diff: @@ -10,8 +10,8 @@ IPWD="$(pwd)"
  echo
  echo "+++ Create and publish API-Doc +++"
  echo
  -if [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "develop" ]; then
  - if [ ! "$TRAVIS_PULL_REQUEST" == "false" ]; then
  +if [[ "$TRAVIS_BRANCH" == "master" ]] || [[ "$TRAVIS_BRANCH" == "develop" ]] || [[ -z $TRAVIS_TAG ]]; then
  + if [[ ! "$TRAVIS_PULL_REQUEST" == "false" ]] || [[ -z $TRAVIS_TAG ]]; then
  if [[ -z $GITHUB_TOKEN ]]; then
  echo "${RED}+ ERROR: NO GITHUB_TOKEN ENVVAR DEFINED. GO TO TRAVIS-SETTINGS AND DEFINE ONE.${NC}"
  exit 1
  @@ -20,14 +20,29 @@ if [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "develop" ]; then
  echo "+ Generate API-Doc"
  cd api
  npm run apidoc
  - echo "+ Publish API-Doc to h-da/geli-doc"
  - ls -lah ./ ./apidocs # for debug only
  - cd apidocs
  - echo "+ git init" ; git init
  - echo "+ git checkout" ; git checkout -b gh-pages
  - echo "+ git add" ; git add . &>/dev/null
  - echo "+ git commit" ; git -c user.name='Travis' -c user.email='travis@travis-ci.org' commit -m "Travis build: $TRAVIS_BUILD_NUMBER" &>/dev/null
  - echo "+ git push" ; git push -f -q https://micpah:$GITHUB_TOKEN@github.com/h-da/geli-docs master &>/dev/null
  + echo "+ Publish API-Doc to h-da/geli-docs"
  +
  + echo "+ git set user.name" ; git config --global user.name 'Travis'
  + echo "+ git set user.email" ; git config --global user.email 'travis@travis-ci.org'
  +
  + echo "+ Clone geli-docs" ; git clone https://micpah:$GITHUB_TOKEN@github.com/h-da/geli-docs.git -q -b master geli-docs &>/dev/null
  + ls -la geli-docs
  + echo "+ Clear geli-docs" ; find geli-docs | grep -v -E 'geli-docs$|geli-docs/.git$|geli-docs/.git/' | xargs 'rm -rf'
  + ls -la geli-docs
  + echo "+ Copy files" ; cp -rT ./apidocs ./geli-docs
  + ls -la geli-docs
  +
  + cd geli-docs
  + echo "+ git add" ; git add --all &>/dev/null
  + echo "+ git commit" ; git commit -m "Travis build: $TRAVIS_BUILD_NUMBER" &>/dev/null
  +
  + if [[ ! -z $TRAVIS_TAG ]]; then
  + echo "+ git tag" ; git tag $TRAVIS_TAG
  + else
  + echo "${YELLOW}+ skipping: git tag - not tagged build${NC}"
  + fi
  +
  + echo "+ git push" ; git push --all --tags -q &>/dev/null
  else
  echo -e "${YELLOW}+ WARNING: pull request #$TRAVIS_PULL_REQUEST -> skipping api-doc${NC}";
  fi
  