Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Transifex client used in Travis. #804

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ dist: trusty
# Container-based infrastructure
sudo: false

# Install python dependencies in the home directory (no sudo access)
# Transifex-client version 0.12.1 is required
# See https://github.com/transifex/transifex-client/issues/113
install:
- echo "Installing the Transifex client"
- pip install --user 'git+https://github.com/eliben/pycparser@release_v2.14'
- pip install --user 'requests[security]'
- pip install --user transifex-client

env:
global:
# $TRANSIFEX_PASSWORD for Transifex (travis encrypt)
secure: c2LmAS3T90ZsRQCj5Qn2GUhWLU3DLumcD2jTMwTdnY8xwLPfsT8WOxPKq03aF/AnUH//67lRMToS5V4mYh/5sek7GX67+HMJBenQOuUjaSpcSK3/ik9hheTVt4M5i5Pu5JZrTe+D3LvGzukasho9jwmR/F0q6gmZYcfpkIKZ5QQ=

# Caching Gradle
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
Expand Down
13 changes: 8 additions & 5 deletions script/transifex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@
#
# Generate and push the source language file to Transifex.
# This script is called after every successful build on Travis CI.
# It relies on $TRANSIFEX_PASSWORD being set in .travis.yml
# The Transifex client must be installed.

if [ "$TRAVIS_REPO_SLUG" == "Electrical-Age/ElectricalAge" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "develop" ]
Copy link
Member Author

@metc metc Oct 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cm0x4D Just realized this one will be hard to sanity check and get green before merging since the script this is not executed for PR :)

then
echo "Installing Transifex client"
pip install virtualenv
virtualenv ~/env
source ~/env/bin/activate
pip install transifex-client

echo "Generating the latest language source file from the develop branch"
./gradlew updateMasterLanguageFile

echo "Submitting the generated translation source file to Transifex"
# Write .transifexrc file
echo "[https://www.transifex.com]
hostname = https://www.transifex.com
password = $TRANSIFEX_PASSWORD
token =
username = metc" > ~/.transifexrc
token = $TRANSIFEX_API_TOKEN
username = $TRANSIFEX_USER" > ~/.transifexrc

tx push --source --translations -l en_us --no-interactive --skip

Expand Down