8000 Introduce environment variables · python/python-docs-ja@776b1cc · GitHub
[go: up one dir, main page]

Skip to content

Commit 776b1cc

Browse files
committed
Introduce environment variables
1 parent 1f25946 commit 776b1cc

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

.travis.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,19 @@ python: '3.6'
55
branches:
66
only:
77
- 3.6
8+
env:
9+
global:
10+
# branch name of python-docs-ja repository
11+
- DOCS_BRANCH=3.6
12+
# branch name of cpython repository
13+
- CPYTHON_BRANCH=3.6
14+
# branch name of cpython-doc-catalog repository
15+
- CATALOG_BRANCH=catalog-3.6
16+
# Transifex project name
17+
- TRANSIFEX_PROJECT=python-36
818
before_install:
919
- export TZ=Asia/Tokyo
10-
- git checkout 3.6
20+
- git checkout ${DOCS_BRANCH}
1121
- openssl aes-256-cbc -K $encrypted_9796e8faf501_key -iv $encrypted_9796e8faf501_iv -in secrets.tar.enc -out secrets.tar -d
1222
- cd ..
1323
- pwd
@@ -29,7 +39,7 @@ install:
2939
- pip install transifex-client
3040
- pip install sphinx-intl
3141
- cd "${BASEDIR}"
32-
- git clone --depth 50 --branch catalog-3.6 https://github.com/python-doc-ja/cpython-doc-catalog.git cpython-doc-catalog
42+
- git clone --depth 50 --branch ${CATALOG_BRANCH} https://github.com/python-doc-ja/cpython-doc-catalog.git cpython-doc-catalog
3343
- mkdir -p "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja
3444
- cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja
3545
- ln -s "${BASEDIR}"/python-docs-ja LC_MESSAGES
@@ -40,14 +50,14 @@ script:
4050
- tx pull --force --language ja
4151
- cd ja/LC_MESSAGES
4252
- git add .
43-
- if [ $(git status --short | wc -l) -eq 0 ]; then echo "no .po file to upload"; else echo "I have .po file(s) to upload"; git commit --message="[skip ci] Update .po files"; git push --quiet "git@python-docs-ja.github.com:python/python-docs-ja.git" 3.6:3.6; fi
53+
- if [ $(git status --short | wc -l) -eq 0 ]; then echo "no .po file to upload"; else echo "I have .po file(s) to upload"; git commit --message="[skip ci] Update .po files"; git push --quiet "git@python-docs-ja.github.com:python/python-docs-ja.git" ${DOCS_BRANCH}:${DOCS_BRANCH}; fi
4454
- rm -rf "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja
4555
# renew-catalog-template
4656
- cd "${BASEDIR}"/cpython-doc-catalog
4757
- git remote add upstream https://github.com/python/cpython.git
4858
- git remote -v
4959
- git fetch --quiet upstream
50-
- git merge --no-ff upstream/3.6 -m "Merge remote-tracking branch 'upstream/3.6' into catalog-3.6 by Autobuild bot on TravisCI"
60+
- git merge --no-ff upstream/${CPYTHON_BRANCH} -m "Merge remote-tracking branch 'upstream/${CPYTHON_BRANCH}' into ${CATALOG_BRANCH} by Autobuild bot on TravisCI"
5161
- cd Doc
5262
- make build ALLSPHINXOPTS="-E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot"
5363
- ls -lt locales/pot
@@ -56,8 +66,8 @@ script:
5666
- if [ $(git status -s | wc -l) -eq 0 ]; then echo "no .pot file to update"; exit 0; else echo "I have .pot file(s) to upload"; fi
5767
- rm -rf .tx
5868
- sphinx-intl create-txconfig
59-
- sphinx-intl update-txconfig-resources --transifex-project-name=python-36 --locale-dir . --pot-dir pot
69+
- sphinx-intl update-txconfig-resources --transifex-project-name=${TRANSIFEX_PROJECT} --locale-dir . --pot-dir pot
6070
- tx push -s
6171
- git add .tx
6272
- git commit --message="[skip ci] Update .pot files and .tx/config"
63-
- git push --quiet "git@cpython-doc-catalog.github.com:python-doc-ja/cpython-doc-catalog.git" catalog-3.6:catalog-3.6
73+
- git push --quiet "git@cpython-doc-catalog.github.com:python-doc-ja/cpython-doc-catalog.git" ${CATALOG_BRANCH}:${CATALOG_BRANCH}

0 commit comments

Comments
 (0)
0