mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-10 02:46:38 +00:00
Auto deploy base translations with Travis (#599)
This commit is contained in:
parent
f81429702c
commit
86128d54b4
@ -19,6 +19,15 @@ script:
|
|||||||
- npm run test
|
- npm run test
|
||||||
- xvfb-run wct
|
- xvfb-run wct
|
||||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --plugin sauce; fi
|
- 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
|
dist: trusty
|
||||||
addons:
|
addons:
|
||||||
sauce_connect: true
|
sauce_connect: true
|
||||||
|
@ -26,8 +26,7 @@ LANG_ISO=en
|
|||||||
|
|
||||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
if [ "$CURRENT_BRANCH" != "master" ]
|
if [ "${CURRENT_BRANCH}" != "master" ] && [ "${TRAVIS_BRANCH}" != "master" ] ; then
|
||||||
then
|
|
||||||
echo "Please only run the translations upload script from a clean checkout of master."
|
echo "Please only run the translations upload script from a clean checkout of master."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
15
script/travis_deploy
Executable file
15
script/travis_deploy
Executable 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
|
Loading…
x
Reference in New Issue
Block a user