Automate and switch to reviewed

* Add travis deploy step for cron job to update automatically.
* switch to reviewed translations
* make update script check for non-zero return codes from the update and test.
This commit is contained in:
chrisgarrity 2018-12-06 11:45:45 -05:00
parent 8802f277ad
commit 475aee4a65
5 changed files with 16 additions and 11 deletions

View file

@ -1,6 +1,6 @@
language: node_js
node_js:
- 6
- 8
- node
cache:
directories:
@ -9,16 +9,23 @@ jobs:
include:
- stage: npm release
if: branch = master OR branch = npm-publish
node_js: 6
node_js: 8
script: npm run build
before_deploy:
- VPKG=$($(npm bin)/json -f package.json version)
- export VERSION=${VPKG/%?/}$(date +%Y%m%d%H%M%S)
- npm --no-git-tag-version version $VERSION
deploy:
provider: npm
- provider: script
skip_cleanup: true
script: npm run update
on:
branch: master
condition: $TRAVIS_EVENT_TYPE == cron
- provider: npm
skip_cleanup: true
email: $NPM_EMAIL
api_key: $NPM_TOKEN
on:
all_branches: true
condition: $TRAVIS_EVENT_TYPE != cron

View file

@ -21,6 +21,7 @@
"pull:blocks": "babel-node scripts/tx-pull-blocks ./editor/blocks/",
"pull:editor": "npm run pull:blocks && npm run pull:extensions && npm run pull:paint && npm run pull:interface",
"test": "npm run lint:js && npm run validate:editor && npm run build && npm run lint:json",
"update": "scripts/update-translations.sh",
"validate:blocks": "babel-node scripts/validate-translations ./editor/blocks/",
"validate:extensions": "babel-node scripts/validate-translations ./editor/extensions/",
"validate:interface": "babel-node scripts/validate-translations ./editor/interface/",

View file

@ -33,8 +33,7 @@ import locales, {localeMap} from '../src/supported-locales.js';
const PROJECT = 'scratch-editor';
const RESOURCE = 'blocks';
const OUTPUT_DIR = path.resolve(args[0]);
// TODO: convert mode to 'reviewed' before January
const MODE = {mode: 'default'};
const MODE = {mode: 'reviewed'};
const CONCURRENCY_LIMIT = 4;
const TX = new transifex({

View file

@ -36,8 +36,7 @@ import locales, {localeMap} from '../src/supported-locales.js';
const PROJECT = args[0];
const RESOURCE = args[1];
const OUTPUT_DIR = path.resolve(args[2]);
// TODO: convert mode to 'reviewed' before January
const MODE = {mode: 'default'};
const MODE = {mode: 'reviewed'};
const CONCURRENCY_LIMIT = 4;
const TX = new transifex({

7
scripts/update-translations.sh Normal file → Executable file
View file

@ -1,13 +1,12 @@
#!/bin/bash
# script for syncing translations from transifex and comitting the changes.
git checkout master
# exit if either the pulls or the test fail
npm run pull:editor
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
npm run test
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
git add .
git commit -m "pull new editor translations from Transifex"