Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit994ba43

Browse files
authored
Merge pull request#21 from python/pr-build_3.7
Tidy up build scripts
2 parentsb4953d2 +f39e9e9 commit994ba43

File tree

4 files changed

+95
-51
lines changed

4 files changed

+95
-51
lines changed

‎.travis.yml

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
dist:trusty
1+
dist:xenial
22
language:python
3-
python:'3.6'
3+
python:'3.7'
44
branches:
55
only:
66
-3.7
@@ -14,61 +14,17 @@ env:
1414
-CATALOG_BRANCH=catalog-3.7
1515
# Transifex project name
1616
-TRANSIFEX_PROJECT=python-newest
17+
# Directory where repositories are cloned
18+
-BASEDIR="$(dirname ${TRAVIS_BUILD_DIR})"
1719
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 ${TRAVIS_BUILD_DIR}/scripts/before_install_3.7
3621
install:
3722
-pip install sphinx
3823
-pip install blurb
3924
-pip install transifex-client
4025
-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
4726
script:
4827
# 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 ${TRAVIS_BUILD_DIR}/scripts/upload-catalog
5629
# 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 ${TRAVIS_BUILD_DIR}/scripts/renew-catalog-template

‎scripts/before_install_3.7

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
set -eux
3+
4+
ls -la${BASEDIR}
5+
git config --global user.email"travisci-build-bot@example.com"
6+
git config --global user.name"Autobuild bot on TravisCI"
7+
git checkout${DOCS_BRANCH}
8+
9+
# extract secrets
10+
cd~
11+
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
12+
tar xvf~/secrets_${DOCS_BRANCH}.tar
13+
rm~/secrets_${DOCS_BRANCH}.tar
14+
chmod 600~/.ssh/python-docs-ja_${DOCS_BRANCH}
15+
chmod 600~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH}
16+
17+
# enable using plural deploy keys for repositories
18+
# Hack from: https://gist.github.com/jamesmcfadden/d379e04e7ae2861414886af189ec59e5
19+
cat<<EOF >> ~/.ssh/config
20+
Host python-docs-ja.github.com
21+
HostName github.com
22+
IdentityFile ~/.ssh/python-docs-ja_${DOCS_BRANCH}
23+
StrictHostKeyChecking no
24+
25+
Host cpython-doc-catalog.github.com
26+
HostName github.com
27+
IdentityFile ~/.ssh/cpython-doc-catalog_${CATALOG_BRANCH}
28+
StrictHostKeyChecking no
29+
EOF
30+
31+
cat~/.ssh/config

‎scripts/renew-catalog-template

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
set -eux
3+
4+
# merge from upstream
5+
cd"${BASEDIR}"/cpython-doc-catalog
6+
git remote add upstream https://github.com/python/cpython.git
7+
git remote -v
8+
git fetch --quiet upstream
9+
git merge --no-ff upstream/${CPYTHON_BRANCH} -m"Merge remote-tracking branch 'upstream/${CPYTHON_BRANCH}' into${CATALOG_BRANCH} by Autobuild bot on TravisCI"
10+
11+
# generate catalog
12+
cd Doc
13+
make build ALLSPHINXOPTS="-E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot"
14+
ls -lt locales/pot
15+
16+
# upload catalog templates to cpython-doc-catalog
17+
cd locales
18+
git add pot
19+
if [$(git status -s| wc -l)-eq 0 ];then
20+
echo"no .pot file to update"
21+
exit 0
22+
fi
23+
24+
echo"I have .pot file(s) to upload"
25+
26+
rm -rf .tx
27+
sphinx-intl create-txconfig
28+
sphinx-intl update-txconfig-resources --transifex-project-name=${TRANSIFEX_PROJECT} --locale-dir. --pot-dir pot
29+
tx push -s
30+
git add .tx
31+
git commit --message="[skip ci] Update .pot files and .tx/config"
32+
git push --quiet"git@cpython-doc-catalog.github.com:python-doc-ja/cpython-doc-catalog.git"${CATALOG_BRANCH}:${CATALOG_BRANCH}

‎scripts/upload-catalog

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
set -eux
3+
4+
# clone an additional repository
5+
cd"${BASEDIR}"
6+
git clone --depth 50 --branch${CATALOG_BRANCH} https://github.com/python-doc-ja/cpython-doc-catalog.git cpython-doc-catalog
7+
mkdir -p"${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja
8+
cd"${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja
9+
ln -s"${BASEDIR}"/python-docs-ja LC_MESSAGES
10+
ls -lF LC_MESSAGES
11+
12+
# upload catalogs to python-docs-ja
13+
cd"${BASEDIR}"/cpython-doc-catalog/Doc/locales
14+
tx pull --force --language ja
15+
cd ja/LC_MESSAGES
16+
git add*.po**/*.po
17+
git status
18+
if [$(git status --short| wc -l)-eq 0 ];then
19+
echo"no .po file to upload"
20+
else
21+
echo"I have .po file(s) to upload"
22+
git commit --message="[skip ci] Update .po files"
23+
git push --quiet"git@python-docs-ja.github.com:python/python-docs-ja.git"${DOCS_BRANCH}:${DOCS_BRANCH}
24+
fi
25+
rm -rf"${BASEDIR}"/cpython-doc-catalog/Doc/locales/ja

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp