|
1 |
| -dist: trusty |
| 1 | +dist: xenial |
2 | 2 | language: python
|
3 |
| -python: '3.6' |
| 3 | +python: '3.7' |
4 | 4 | branches:
|
5 | 5 | only:
|
6 | 6 | - 3.7
|
|
14 | 14 | - CATALOG_BRANCH=catalog-3.7
|
15 | 15 | # Transifex project name
|
16 | 16 | - TRANSIFEX_PROJECT=python-newest
|
| 17 | + # Directory where repositories are cloned |
| 18 | + - BASEDIR="$(dirname ${TRAVIS_BUILD_DIR})" |
17 | 19 | before_install:
|
18 |
| -- export TZ=Asia/Tokyo |
19 |
| -- git checkout ${DOCS_BRANCH} |
20 |
| -- cd .. |
21 |
| -- pwd |
22 |
| -- ls -la |
23 |
| -- BASEDIR="$(pwd)" |
24 |
| -- cd ~ |
25 |
| -- openssl aes-256-cbc -K ${encryption_37_K} -iv ${encryption_37_iv} -in "${BASEDIR}/python-docs-ja/secrets_${DOCS_BRANCH}.tar.enc" -out ~/secrets_${DOCS_BRANCH}.tar -d |
26 |
| -- tar xvf ~/secrets_${DOCS_BRANCH}.tar |
27 |
| -- rm ~/secrets_${DOCS_BRANCH}.tar |
28 |
| -- chmod 600 ~/.ssh/python-docs-ja_${DOCS_BRANCH} |
29 |
| -- chmod 600 ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH} |
30 |
| -# Hack from: https://gist.github.com/jamesmcfadden/d379e04e7ae2861414886af189ec59e5 |
31 |
| -- echo -e "Host python-docs-ja.github.com\n\tHostName github.com\n\tIdentityFile ~/.ssh/python-docs-ja_${DOCS_BRANCH}\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config |
32 |
| -- echo -e "Host cpython-doc-catalog.github.com\n\tHostName github.com\n\tIdentityFile ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH}\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config |
33 |
| -- cat ~/.ssh/config |
34 |
| -- git config --global user.email "travisci-build-bot@example.com" |
35 |
| -- git config --global user.name "Autobuild bot on TravisCI" |
| 20 | +- bash ./scripts/before_install_3.7 |
36 | 21 | install:
|
37 | 22 | - pip install sphinx
|
38 | 23 | - pip install blurb
|
39 | 24 | - pip install transifex-client
|
40 | 25 | - pip install sphinx-intl
|
41 |
| -- cd "${BASEDIR}" |
42 |
| -- git clone --depth 50 --branch ${CATALOG_BRANCH} https://github.com/python-doc-ja/cpython-doc-catalog.git cpython-doc-catalog |
43 |
| -- mkdir -p "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja |
44 |
| -- cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja |
45 |
| -- ln -s "${BASEDIR}"/python-docs-ja LC_MESSAGES |
46 |
| -- ls -lF LC_MESSAGES |
47 | 26 | script:
|
48 | 27 | # upload-catalog
|
49 |
| -- cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales |
50 |
| -- tx pull --force --language ja |
51 |
| -- cd ja/LC_MESSAGES |
52 |
| -- git add *.po **/*.po |
53 |
| -- git status |
54 |
| -- 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 |
55 |
| -- rm -rf "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja |
| 28 | +- bash ./scripts/upload-catalog |
56 | 29 | # renew-catalog-template
|
57 |
| -- cd "${BASEDIR}"/cpython-doc-catalog |
58 |
| -- git remote add upstream https://github.com/python/cpython.git |
59 |
| -- git remote -v |
60 |
| -- git fetch --quiet upstream |
61 |
| -- git merge --no-ff upstream/${CPYTHON_BRANCH} -m "Merge remote-tracking branch 'upstream/${CPYTHON_BRANCH}' into ${CATALOG_BRANCH} by Autobuild bot on TravisCI" |
62 |
| -- cd Doc |
63 |
| -- make build ALLSPHINXOPTS="-E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot" |
64 |
| -- ls -lt locales/pot |
65 |
| -- cd locales |
66 |
| -- git add pot |
67 |
| -- 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 |
68 |
| -- rm -rf .tx |
69 |
| -- sphinx-intl create-txconfig |
70 |
| -- sphinx-intl update-txconfig-resources --transifex-project-name=${TRANSIFEX_PROJECT} --locale-dir . --pot-dir pot |
71 |
| -- tx push -s |
72 |
| -- git add .tx |
73 |
| -- git commit --message="[skip ci] Update .pot files and .tx/config" |
74 |
| -- git push --quiet "git@cpython-doc-catalog.github.com:python-doc-ja/cpython-doc-catalog.git" ${CATALOG_BRANCH}:${CATALOG_BRANCH} |
| 30 | +- bash ./scripts/renew-catalog-template |
0 commit comments