From d6066418a246a2adcfdd84ae34dd17c41e690c37 Mon Sep 17 00:00:00 2001 From: Nicco Kunzmann Date: Thu, 14 Mar 2019 07:54:04 +0100 Subject: [PATCH 1/2] disable Transifex for tags - no push and pull on tags - no push on other branches - https://travis-ci.org/niccokunzmann/12characters-translations/builds/504909091#L815 --- .travis.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index aecd555..2e83cbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,15 +16,26 @@ services: before_install: - docker pull niccokunzmann/ci-latex + # set the branch from which we release the book + - export RELEASE_BRANCH="master" script: - # check if we know the secrets to update the text from Transifex - - USE_TRANSIFEX="$TRAVIS_SECURE_ENV_VARS" + # check if we know the secrets to update the text from Transifex. + # tags do not need to pull and push anything as we release from a branch. + # see https://docs-staging.travis-ci.com/user/environment-variables/#default-environment-variables + # set USE_TRANSIFEX to "true" or "false" + - if [ -z "$TRAVIS_TAG" ]; then USE_TRANSIFEX="$TRAVIS_SECURE_ENV_VARS"; else USE_TRANSIFEX="false"; done - echo "Using Trasifex? $USE_TRANSIFEX" + # check if we are on a release branch + # see https://docs-staging.travis-ci.com/user/environment-variables/#default-environment-variables + # set IS_RELEASE to "true" or "false" + - if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "$RELEASE_BRANCH" ]; then IS_RELEASE="true"; else IS_RELEASE="false"; fi + - echo "Is this a release on $RELEASE_BRANCH? $IS_RELEASE" # use the TRANSIFEX_PASSWORD variable to setup the client credetials - if [ "$USE_TRANSIFEX" == "true" ]; then .tx/prepare-transifex.sh; fi # push new source files and ignore errors - - if [ "$USE_TRANSIFEX" == "true" ]; then tx push --source --skip; fi + # only do this on the master branch + - if [ "$USE_TRANSIFEX" == "true" ] && [ "$IS_RELEASE" == "true" ]; then tx push --source --skip; fi # pull translation files even if they exist - if [ "$USE_TRANSIFEX" == "true" ]; then tx pull --all --force; fi # update statistics for the PDF file @@ -49,5 +60,5 @@ deploy: - pdf/books/* skip_cleanup: true on: - branch: master + branch: "$RELEASE_BRANCH" From 6037dd1ffeafd9024d74ff309341d43b8295d675 Mon Sep 17 00:00:00 2001 From: Nicco Kunzmann Date: Thu, 14 Mar 2019 08:01:55 +0100 Subject: [PATCH 2/2] fix syntax error - https://travis-ci.org/niccokunzmann/12characters-translations/builds/506142145#L617 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2e83cbf..e2b133b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ script: # tags do not need to pull and push anything as we release from a branch. # see https://docs-staging.travis-ci.com/user/environment-variables/#default-environment-variables # set USE_TRANSIFEX to "true" or "false" - - if [ -z "$TRAVIS_TAG" ]; then USE_TRANSIFEX="$TRAVIS_SECURE_ENV_VARS"; else USE_TRANSIFEX="false"; done + - if [ -z "$TRAVIS_TAG" ]; then USE_TRANSIFEX="$TRAVIS_SECURE_ENV_VARS"; else USE_TRANSIFEX="false"; fi - echo "Using Trasifex? $USE_TRANSIFEX" # check if we are on a release branch # see https://docs-staging.travis-ci.com/user/environment-variables/#default-environment-variables