From ee783a0f16b91c35ca8482d8651b28aef1554101 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sat, 1 Jul 2017 09:09:06 -0400 Subject: [PATCH] Do not push translation strings to Transifex for pull requests --- .travis.yml | 8 +------- scripts/txpush.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 scripts/txpush.sh diff --git a/.travis.yml b/.travis.yml index b74ebb9f4..2463156b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/scripts/txpush.sh b/scripts/txpush.sh new file mode 100644 index 000000000..5351be876 --- /dev/null +++ b/scripts/txpush.sh @@ -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