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

Commit 26c0dcc

Browse files
btryajsb85
authored andcommitted
ci: group after success tasks in a single script
Signed-off-by: Thierry Bugier <[email protected]>
1 parent 72f3d55 commit 26c0dcc

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ script:
4343
- 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
4444

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

5049
cache:
5150
directories:

.github/push_ghpages.sh renamed to tests/after_success.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
#!/bin/sh
2-
# please set the $GH_TOKEN in your travis dashboard
2+
#
3+
# After success script for Travis CI
4+
#
5+
6+
# please keep tasks strongly separated,
7+
# no matter they have the same if block
38

9+
# please set $TX_USER and $TX_TOKEN in your travis dashboard
10+
if [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
11+
echo "updating source language"
12+
sudo apt install transifex-client
13+
echo "[https://www.transifex.com]" > ~/.transifexrc
14+
echo "api_hostname = https://api.transifex.com" >> ~/.transifexrc
15+
echo "hostname = https://www.transifex.com" >> ~/.transifexrc
16+
echo "token = ${TX_TOKEN}" >> ~/.transifexrc
17+
echo "password = ${TX_TOKEN}" >> ~/.transifexrc
18+
echo "username = ${TX_USER}" >> ~/.transifexrc
19+
php vendor/bin/robo locales:send
20+
else
21+
echo "skipping source language update"
22+
fi
23+
24+
# please set the $GH_TOKEN in your travis dashboard
425
if [ "$TRAVIS_BRANCH" = "develop" ] && [ "$TRAVIS_PULL_REQUEST" = false ]; then
526
#wget http://get.sensiolabs.org/sami.phar -O "$HOME/bin/sami.phar"
627
# setup_git only for the main repo and not forks

tests/update_locales.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)