[WIP] conditions for cron job on travis

This commit is contained in:
chrisgarrity 2018-12-07 08:40:46 -05:00
parent 283a16c298
commit a591ea9212
2 changed files with 11 additions and 15 deletions

View file

@ -7,8 +7,11 @@ cache:
- node_modules - node_modules
jobs: jobs:
include: include:
- stage: update translations
if: $TRAVIS_EVENT_TYPE == cron
script: ./scripts/update-translations.sh
- stage: npm release - stage: npm release
if: branch = master OR branch = npm-publish if: (branch = master OR branch = npm-publish) AND $TRAVIS_EVENT_TYPE != cron
node_js: 8 node_js: 8
script: npm run build script: npm run build
before_deploy: before_deploy:
@ -16,16 +19,9 @@ jobs:
- export VERSION=${VPKG/%?/}$(date +%Y%m%d%H%M%S) - export VERSION=${VPKG/%?/}$(date +%Y%m%d%H%M%S)
- npm --no-git-tag-version version $VERSION - npm --no-git-tag-version version $VERSION
deploy: deploy:
- provider: script provider: npm
skip_cleanup: true
script: npm run update
on:
branch: master
condition: $TRAVIS_EVENT_TYPE == cron
- provider: npm
skip_cleanup: true skip_cleanup: true
email: $NPM_EMAIL email: $NPM_EMAIL
api_key: $NPM_TOKEN api_key: $NPM_TOKEN
on: on:
all_branches: true all_branches: true
condition: $TRAVIS_EVENT_TYPE != cron

View file

@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
# script for syncing translations from transifex and comitting the changes. # script for syncing translations from transifex and comitting the changes.
# exit if either the pulls or the test fail
# exit script if any command returns a non-zero return code:
set -ev
npm run pull:editor npm run pull:editor
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi #exit if pull failed
npm run test npm run test
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi #exit if test failed
# commit any updates and push. Build and release should happen on the push not here.
git add . git add .
git commit -m "pull new editor translations from Transifex" git commit -m "pull new editor translations from Transifex"
git push git push