Auto deploy base translations with Travis (#599)

This commit is contained in:
Adam Mills 2017-11-09 22:15:55 -05:00 committed by Paulus Schoutsen
parent f81429702c
commit 86128d54b4
3 changed files with 25 additions and 2 deletions

View File

@ -19,6 +19,15 @@ script:
- npm run test
- xvfb-run wct
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --plugin sauce; fi
services:
- docker
before_deploy:
- docker pull lokalise/lokalise-cli
deploy:
provider: script
script: script/travis_deploy
on:
branch: master
dist: trusty
addons:
sauce_connect: true

View File

@ -26,8 +26,7 @@ LANG_ISO=en
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$CURRENT_BRANCH" != "master" ]
then
if [ "${CURRENT_BRANCH}" != "master" ] && [ "${TRAVIS_BRANCH}" != "master" ] ; then
echo "Please only run the translations upload script from a clean checkout of master."
exit 1
fi

15
script/travis_deploy Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Safe bash settings
# -e Exit on command fail
# -u Exit on unset variable
# -o pipefail Exit if piped command has error code
set -eu -o pipefail
cd "$(dirname "$0")/.."
if git diff "${TRAVIS_COMMIT_RANGE}" --name-only | grep -Fxq "src/translations/en.json" ; then
script/translations_upload_base
else
echo "No changes to src/translations/en.json. Skipping translation upload."
fi