Do not push translation strings to Transifex for pull requests

This commit is contained in:
Bryan Housel
2017-07-01 09:09:06 -04:00
parent 54a8ae439a
commit ee783a0f16
2 changed files with 18 additions and 7 deletions

View File

@@ -5,10 +5,4 @@ node_js:
- "8"
sudo: required
after_success:
- if [[ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]]; then exit 0; fi
- pip install virtualenv
- virtualenv ~/env
- source ~/env/bin/activate
- pip install transifex-client
- sudo echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = '"$TRANSIFEX_USER"$'\npassword = '"$TRANSIFEX_PASSWORD"$'\n' > ~/.transifexrc
- tx push -s
- ./scripts/txpush.sh

17
scripts/txpush.sh Normal file
View File

@@ -0,0 +1,17 @@
#/bin/bash
# This script runs on TravisCI to push new translation strings to transifex
echo $"TRAVIS"
echo $"TRAVIS_PULL_REQUEST"
echo $"TRAVIS_BRANCH"
if [[ "$TRAVIS" != "true" -o $"TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "master" ]]; then exit 0; fi
echo "Pushing source strings to Transifex..."
pip install virtualenv
virtualenv ~/env
source ~/env/bin/activate
pip install transifex-client
sudo echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = '"$TRANSIFEX_USER"$'\npassword = '"$TRANSIFEX_PASSWORD"$'\n' > ~/.transifexrc
tx push -s