-
-
Notifications
You must be signed in to change notification settings - Fork 33
Tidy up build scripts #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dist: trusty | ||
dist: xenial | ||
language: python | ||
python: '3.6' | ||
python: '3.7' | ||
branches: | ||
only: | ||
- 3.7 | ||
|
@@ -14,61 +14,17 @@ env: | |
- CATALOG_BRANCH=catalog-3.7 | ||
# Transifex project name | ||
- TRANSIFEX_PROJECT=python-newest | ||
# Directory where repositories are cloned | ||
- BASEDIR="$(dirname ${TRAVIS_BUILD_DIR})" | ||
before_install: | ||
- export TZ=Asia/Tokyo | ||
- git checkout ${DOCS_BRANCH} | ||
- cd .. | ||
- pwd | ||
- ls -la | ||
- BASEDIR="$(pwd)" | ||
- cd ~ | ||
- 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 | ||
- tar xvf ~/secrets_${DOCS_BRANCH}.tar | ||
- rm ~/secrets_${DOCS_BRANCH}.tar | ||
- chmod 600 ~/.ssh/python-docs-ja_${DOCS_BRANCH} | ||
- chmod 600 ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH} | ||
# Hack from: https://gist.github.com/jamesmcfadden/d379e04e7ae2861414886af189ec59e5 | ||
- 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 | ||
- 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 | ||
- cat ~/.ssh/config | ||
- git config --global user.email "[email protected]" | ||
- git config --global user.name "Autobuild bot on TravisCI" | ||
- bash ${TRAVIS_BUILD_DIR}/scripts/before_install_3.7 | ||
install: | ||
- pip install sphinx | ||
- pip install blurb | ||
- pip install transifex-client | ||
- pip install sphinx-intl | ||
- cd "${BASEDIR}" | ||
- git clone --depth 50 --branch ${CATALOG_BRANCH} https://github.com/python-doc-ja/cpython-doc-catalog.git cpython-doc-catalog | ||
- mkdir -p "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja | ||
- cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja | ||
- ln -s "${BASEDIR}"/python-docs-ja LC_MESSAGES | ||
- ls -lF LC_MESSAGES | ||
script: | ||
# upload-catalog | ||
- cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales | ||
- tx pull --force --language ja | ||
- cd ja/LC_MESSAGES | ||
- git add *.po **/*.po | ||
- git status | ||
- 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 "[email protected]:python/python-docs-ja.git" ${DOCS_BRANCH}:${DOCS_BRANCH}; fi | ||
- rm -rf "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja | ||
- bash ${TRAVIS_BUILD_DIR}/scripts/upload-catalog | ||
# renew-catalog-template | ||
- cd "${BASEDIR}"/cpython-doc-catalog | ||
- git remote add upstream https://github.com/python/cpython.git | ||
- git remote -v | ||
- git fetch --quiet upstream | ||
- git merge --no-ff upstream/${CPYTHON_BRANCH} -m "Merge remote-tracking branch 'upstream/${CPYTHON_BRANCH}' into ${CATALOG_BRANCH} by Autobuild bot on TravisCI" | ||
- cd Doc | ||
- make build ALLSPHINXOPTS="-E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot" | ||
- ls -lt locales/pot | ||
- cd locales | ||
- git add pot | ||
- 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 | ||
- rm -rf .tx | ||
- sphinx-intl create-txconfig | ||
- sphinx-intl update-txconfig-resources --transifex-project-name=${TRANSIFEX_PROJECT} --locale-dir . --pot-dir pot | ||
- tx push -s | ||
- git add .tx | ||
- git commit --message="[skip ci] Update .pot files and .tx/config" | ||
- git push --quiet "[email protected]:python-doc-ja/cpython-doc-catalog.git" ${CATALOG_BRANCH}:${CATALOG_BRANCH} | ||
- bash ${TRAVIS_BUILD_DIR}/scripts/renew-catalog-template |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
ls -la ${BASEDIR} | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Autobuild bot on TravisCI" | ||
git checkout ${DOCS_BRANCH} | ||
|
||
# extract secrets | ||
cd ~ | ||
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 | ||
tar xvf ~/secrets_${DOCS_BRANCH}.tar | ||
rm ~/secrets_${DOCS_BRANCH}.tar | ||
chmod 600 ~/.ssh/python-docs-ja_${DOCS_BRANCH} | ||
chmod 600 ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH} | ||
|
||
# enable using plural deploy keys for repositories | ||
# Hack from: https://gist.github.com/jamesmcfadden/d379e04e7ae2861414886af189ec59e5 | ||
cat <<EOF >> ~/.ssh/config | ||
Host python-docs-ja.github.com | ||
HostName github.com | ||
IdentityFile ~/.ssh/python-docs-ja_${DOCS_BRANCH} | ||
StrictHostKeyChecking no | ||
|
||
Host cpython-doc-catalog.github.com | ||
HostName github.com | ||
IdentityFile ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH} | ||
StrictHostKeyChecking no | ||
EOF | ||
|
||
cat ~/.ssh/config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
# merge from upstream | ||
cd "${BASEDIR}"/cpython-doc-catalog | ||
git remote add upstream https://github.com/python/cpython.git | ||
git remote -v | ||
git fetch --quiet upstream | ||
git merge --no-ff upstream/${CPYTHON_BRANCH} -m "Merge remote-tracking branch 'upstream/${CPYTHON_BRANCH}' into ${CATALOG_BRANCH} by Autobuild bot on TravisCI" | ||
|
||
# generate catalog | ||
cd Doc | ||
make build ALLSPHINXOPTS="-E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot" | ||
ls -lt locales/pot | ||
|
||
# upload catalog templates to cpython-doc-catalog | ||
cd locales | ||
git add pot | ||
if [ $(git status -s | wc -l) -eq 0 ]; then | ||
echo "no .pot file to update" | ||
exit 0 | ||
fi | ||
|
||
echo "I have .pot file(s) to upload" | ||
|
||
rm -rf .tx | ||
sphinx-intl create-txconfig | ||
sphinx-intl update-txconfig-resources --transifex-project-name=${TRANSIFEX_PROJECT} --locale-dir . --pot-dir pot | ||
tx push -s | ||
git add .tx | ||
git commit --message="[skip ci] Update .pot files and .tx/config" | ||
git push --quiet "[email protected]:python-doc-ja/cpython-doc-catalog.git" ${CATALOG_BRANCH}:${CATALOG_BRANCH} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
# clone an additional repository | ||
cd "${BASEDIR}" | ||
git clone --depth 50 --branch ${CATALOG_BRANCH} https://github.com/python-doc-ja/cpython-doc-catalog.git cpython-doc-catalog | ||
mkdir -p "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja | ||
cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja | ||
ln -s "${BASEDIR}"/python-docs-ja LC_MESSAGES | ||
ls -lF LC_MESSAGES | ||
|
||
# upload catalogs to python-docs-ja | ||
cd "${BASEDIR}"/cpython-doc-catalog/Doc/locales | ||
tx pull --force --language ja | ||
cd ja/LC_MESSAGES | ||
git add *.po **/*.po | ||
git status | ||
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 "[email protected]:python/python-docs-ja.git" ${DOCS_BRANCH}:${DOCS_BRANCH} | ||
fi | ||
rm -rf "${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis CIの動作の関係上、PRビルドでは上手く動かないため、いったんマージする。