Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
ci: group after success tasks in a single script
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry authored and ajsb85 committed Jul 11, 2018
1 parent 72f3d55 commit 26c0dcc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ script:
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then vendor/bin/phpcs -p --standard=vendor/glpi-project/coding-standard/GlpiStandard/ *.php install/ inc/ front/ ajax/ tests/; fi

after_success:
# let's update the documentation
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then tests/update_locales.sh; fi
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then .github/push_ghpages.sh; fi
# let's update the documentation and locales
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then tests/after_success.sh; fi

cache:
directories:
Expand Down
23 changes: 22 additions & 1 deletion .github/push_ghpages.sh → tests/after_success.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
#!/bin/sh
# please set the $GH_TOKEN in your travis dashboard
#
# After success script for Travis CI
#

# please keep tasks strongly separated,
# no matter they have the same if block

# please set $TX_USER and $TX_TOKEN in your travis dashboard
if [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
echo "updating source language"
sudo apt install transifex-client
echo "[https://www.transifex.com]" > ~/.transifexrc
echo "api_hostname = https://api.transifex.com" >> ~/.transifexrc
echo "hostname = https://www.transifex.com" >> ~/.transifexrc
echo "token = ${TX_TOKEN}" >> ~/.transifexrc
echo "password = ${TX_TOKEN}" >> ~/.transifexrc
echo "username = ${TX_USER}" >> ~/.transifexrc
php vendor/bin/robo locales:send
else
echo "skipping source language update"
fi

# please set the $GH_TOKEN in your travis dashboard
if [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
#wget http://get.sensiolabs.org/sami.phar -O "$HOME/bin/sami.phar"
# setup_git only for the main repo and not forks
Expand Down
17 changes: 0 additions & 17 deletions tests/update_locales.sh

This file was deleted.

0 comments on commit 26c0dcc

Please sign in to comment.