From d90e5db359ddbbc2b84a2be82649540b763876c9 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Wed, 19 Apr 2017 23:01:59 +0800 Subject: [PATCH 01/18] Replace deploy_key.enc for tatsuya6502/trpl-ja-pdf repository --- .travis.yml | 2 +- deploy_key.enc | 72 +++++++++++++++++++++++++------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95ad563..92fc7f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,4 +52,4 @@ after_success: - git push git@github.com:rust-lang-ja/trpl-ja-pdf.git gh-pages:gh-pages env: global: - secure: ck1uVFgjw0jFayZgV9enDV3n4/D5PiyW3J/ahpHHhTaO9H4tGl6vKzlsbbo9zCPRmYpHyjH/mnEDcfWXViRE72o4wYxA4zbK+JNzJK5mFUuSZB4WrD44HC9jIL99u3mLU+9DnlK6gbE3oz6JRI04Ie9L48+LeCAX6HS4iAuj8ddRIgkVUEKoZPhJ7AbFNcBtU91uQqRmpLWXeLKgkwC9jSmD//zC0DkdTHGoCD2aUCARiwBbWLn17oV8nI37eUEgV/ZaPDmwoV1JSR9KFiokWTH4QiRwwKXnw5n2nHJPmBCmEs5LmQlsuu8puZmlXg6m8xUTIheW0vTbxejZeoNP71M+7MXGP0Ix6Z1rDrx767GORjUpwhSgVwmrz7VCSgZYwze9v2j0NWsDaDXD4kruxF4j7c7YdhzPA/+K6I+NdwVE3zGyRzG6KUySbVXGAFIMzIt/yofTN1PeSy779nrnMiNI9N8AyikYmiT1ocT91j7HzMYTab250yugm6Tl80+wwlpbk0ljYR7m0ZBIopAS8HzzeSrD9Qww6PAQ9EBPvnIlhG62ttUAjRFHe7zrDSzWaD2WvdM+jmeEGCdc1iqQLteWgvsLbXOJd5GJksOgRX/rRa++ioq2/+P/aGEyFeNXWMD3ru2V3eDDL2kBpnLv93JmsdRorGsFDOFsau2i0TI= + secure: e2ePFDSK4MWsMQUidQKS7sbbNYqwJTE1Piie3qQlcPupyMv6T1dNpoB1V4P6aRfekJL+5uQrSFel3ZM2Huiskf8FCI5WLomek97tgfUNVkUAb1HxNAhtwziQU8sTbGMGc52hHlICLiuWYpEeWplFjYAur+Z/20BTbyoP7ajCJqUwc+ZjcxzshGOv+fGSClYu8MhJg4l3yfQpnaOon+2XPk41AI1WdhTOK6IT3L1l7tKo2Vk/k6sYQdfyBNdWWl1rpeddNpwwLVUFr2muzbs2Q0X2r2PCQigj/uXsk80VcDCMOwYdWZRafuZfa7KwHWQGJXsiHxA7Pq3zTZMQRGUzljJjugytl4g55EF0+K2xUScpyYfNVYL4SrKdbQDgw6PGtNYGxNP+DwaLBWTNigin9bCqSkYg3I2L/tqsLH166SRzsq6y/QHvwno8Q8TaTz3uDWR/22d2why3nvFf+neHn+GVG1Cjw6/2L04e+mpgeBgxDz5vjXh2JYvMV1/8squgn33GiDOA00MZFkk8nSUxGzhEqOjAY2tVquW5ReeddL9zq2NCNNTHIjtVM51eHAEuJ/VpSUb4e/vqkDIYGouKHHRfvYlwnONSOksHZ4PqZ6kNGL/Dqo2gKh0931/VldbjQ+F8TgZS6YvzwyLWE/TqZ6LDTnXYHzorO9MGzw4YhK4= diff --git a/deploy_key.enc b/deploy_key.enc index 6140d5d..794f9be 100644 --- a/deploy_key.enc +++ b/deploy_key.enc @@ -1,36 +1,36 @@ -U2FsdGVkX18eZPgC2dl+qGJzBhY8D/xydFqSJswD8sMyrMPfPl/PanBgsWJgDSrf -XyU1k0YjASCD6Y9o6sqe24269NzDPFOKr1Rc9Rp8iux9HR6WzJO1/a+Ci8706e+R -dupUtoeqeAM3MzYd8T/08WNJ0VEnlv/uzNn+zvEt+qOehuRd+JaxlrE8Z5rQCuB9 -582+bc+/Dr8OLnXLDpERJWj96awvNUBw4UfFjhEaBk5S0xQY+6Gyc1OzJbTLm6qY -CcE+D9sO18rcOnta6J/3JmBhzw8OZR0rx1XYPr50Fc6g3SCNS83an3tn/rjZtPop -SoqRlOZsJ3Cg/nXiJnywY6gYFuL+lN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Z+rRpiAF+M145 +F2ksaeR1jhGe+wzJFMnG2j1duFwaEEPPmiutxqMA70SwaobDnqKye2gw+Rg1eoAN +9kAEb2pR/a1oZmdCc9u+bs+HkIRv2709icOyZYBl5mwwCHsPSL+3YIh/s04BECvs +eWBRWo0+WUI3X+r11KOcvBS0zZ1qAy/D3r6wxG4CyJYcQrkyLISw+kkcT0LrUHiM +TtMppaQdwrEilVZCydfc6IW8owfonlK+X+4CEZKLUv+amsZsudcANRGo6P/k9wL7 +5q0dtdTDFsUexiAnA2h7KnLlLM24UkWvBMuovNDTN5pt771e6yjhSQR+eUYsnfKl +BN3iOgvUVsRpxnC6+xcEmQUk1rC35wsQcWXbFLdIC/OvwbRf8ep10s/y2cfcLKC4 +P5uPKlCQbi40WeDYple9R+l8EVV+FNHDNxAFJK9Aae/uM9M186G8Gyy4MPx36e86 +xBOTJKHDtKdLZmYs0am/aPwUyBzAD2q5NBJJM3thGAlNhrwxGDR5uBikNj/7SKmg +eafhRDsoboAaSwQvWrJj/a4we+s/jg/XYJkPhbYpdf3kvmaEeLtn7jbQFu5pDGrv +hQzdhwFWsDuKukz95gmN1IMlY59Bu4jYa00fmda80bLkHu5IqhNYx/PS9bN97aoK +hWoIz9QuSyRHVBwE4FBpAueLm5dK0SOM8J2jbRDnmfM3fpr57rhwIWjeH7Rbx9mP +JYJ+8admpCC8IK/A7/SIVlib85hthddE1YYJEUS1vaMCBj5rTeN3cCS7+z5gYIkx +hEBHDnMvZs+WLmFeKebmzPE5PAGzHMGqAyXTFMjua++ZUsFLWW7EurQ3pYIvsvlW +7IN0gVIEqBe06GvohCGB2pgN3rlixCIEVyIXG25gcsgcoYy4+w6LHZY6yxA0k4kC +9Pw9heOL84uYJYNYGRcLVITSeTfhdLVg0X3yTDCzcPhaf9IJIrCgZDdJvnHcUx6k +f35WRDkiscSZ9cXdEWjpSQ== From d2d1c09c56973aec7a7457b52956245ab9541cdd Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Wed, 19 Apr 2017 23:19:01 +0800 Subject: [PATCH 02/18] Change repository from last-lang-ja/trpl-ja-pdf to tatsuya6502/trpl-ja-pdf --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 92fc7f8..413ec60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ after_success: - git stash pop - git add a4.pdf letter.pdf - git commit -a -m "auto commit on travis $TRAVIS_JOB_NUMBER $TRAVIS_COMMIT" - - git push git@github.com:rust-lang-ja/trpl-ja-pdf.git gh-pages:gh-pages + - git push git@github.com:tatsuya6502/trpl-ja-pdf.git gh-pages:gh-pages env: global: secure: e2ePFDSK4MWsMQUidQKS7sbbNYqwJTE1Piie3qQlcPupyMv6T1dNpoB1V4P6aRfekJL+5uQrSFel3ZM2Huiskf8FCI5WLomek97tgfUNVkUAb1HxNAhtwziQU8sTbGMGc52hHlICLiuWYpEeWplFjYAur+Z/20BTbyoP7ajCJqUwc+ZjcxzshGOv+fGSClYu8MhJg4l3yfQpnaOon+2XPk41AI1WdhTOK6IT3L1l7tKo2Vk/k6sYQdfyBNdWWl1rpeddNpwwLVUFr2muzbs2Q0X2r2PCQigj/uXsk80VcDCMOwYdWZRafuZfa7KwHWQGJXsiHxA7Pq3zTZMQRGUzljJjugytl4g55EF0+K2xUScpyYfNVYL4SrKdbQDgw6PGtNYGxNP+DwaLBWTNigin9bCqSkYg3I2L/tqsLH166SRzsq6y/QHvwno8Q8TaTz3uDWR/22d2why3nvFf+neHn+GVG1Cjw6/2L04e+mpgeBgxDz5vjXh2JYvMV1/8squgn33GiDOA00MZFkk8nSUxGzhEqOjAY2tVquW5ReeddL9zq2NCNNTHIjtVM51eHAEuJ/VpSUb4e/vqkDIYGouKHHRfvYlwnONSOksHZ4PqZ6kNGL/Dqo2gKh0931/VldbjQ+F8TgZS6YvzwyLWE/TqZ6LDTnXYHzorO9MGzw4YhK4= From 489da3cdd82ac9ccd137545ab027ff9df882c97e Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sat, 15 Jul 2017 17:14:55 +0900 Subject: [PATCH 03/18] Update .travis and helper scripts to sync trpl submodule revision automatically --- .travis.yml | 12 ++--- ci-scripts/commit-trpl-submodule-revision.sh | 25 +++++++++++ ci-scripts/publish-pdf.sh | 47 ++++++++++++++++++++ 3 files changed, 76 insertions(+), 8 deletions(-) create mode 100755 ci-scripts/commit-trpl-submodule-revision.sh create mode 100755 ci-scripts/publish-pdf.sh diff --git a/.travis.yml b/.travis.yml index 413ec60..257f17d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ install: - ./tlmgr.sh update --self --all || echo "ignore errors" - ./tlmgr.sh install collection-luatex collection-langjapanese collection-fontsrecommended type1cm mdframed needspace hyphenat quotchap framed everyhook svn-prov before_script: + - (cd the-rust-programming-language-ja && git fetch origin && git checkout master && git pull origin master) - cp trpl_meta.yml trpl-ebook/ - "echo \"pub const RELEASE_DATE: &'static str = \\\"`date +%F`\\\";\" | cat - options.rs.template > options.rs" - cp options.rs trpl-ebook/src/convert_book/ @@ -42,14 +43,9 @@ after_success: - chmod 600 ~/.ssh/deploy.key - git config --global user.email "m@yyu.pw" - git config --global user.name "Yoshimura Yuu" - - git fetch origin gh-pages:gh-pages - - git stash -u - - git checkout gh-pages - - rm a4.pdf letter.pdf - - git stash pop - - git add a4.pdf letter.pdf - - git commit -a -m "auto commit on travis $TRAVIS_JOB_NUMBER $TRAVIS_COMMIT" - - git push git@github.com:tatsuya6502/trpl-ja-pdf.git gh-pages:gh-pages + - ./ci-scripts/commit-trpl-submodule-revision.sh + - ./ci-scripts/publish-pdf.sh env: global: + # This is for tatsuya6502/trpl-ja-pdf repo. secure: e2ePFDSK4MWsMQUidQKS7sbbNYqwJTE1Piie3qQlcPupyMv6T1dNpoB1V4P6aRfekJL+5uQrSFel3ZM2Huiskf8FCI5WLomek97tgfUNVkUAb1HxNAhtwziQU8sTbGMGc52hHlICLiuWYpEeWplFjYAur+Z/20BTbyoP7ajCJqUwc+ZjcxzshGOv+fGSClYu8MhJg4l3yfQpnaOon+2XPk41AI1WdhTOK6IT3L1l7tKo2Vk/k6sYQdfyBNdWWl1rpeddNpwwLVUFr2muzbs2Q0X2r2PCQigj/uXsk80VcDCMOwYdWZRafuZfa7KwHWQGJXsiHxA7Pq3zTZMQRGUzljJjugytl4g55EF0+K2xUScpyYfNVYL4SrKdbQDgw6PGtNYGxNP+DwaLBWTNigin9bCqSkYg3I2L/tqsLH166SRzsq6y/QHvwno8Q8TaTz3uDWR/22d2why3nvFf+neHn+GVG1Cjw6/2L04e+mpgeBgxDz5vjXh2JYvMV1/8squgn33GiDOA00MZFkk8nSUxGzhEqOjAY2tVquW5ReeddL9zq2NCNNTHIjtVM51eHAEuJ/VpSUb4e/vqkDIYGouKHHRfvYlwnONSOksHZ4PqZ6kNGL/Dqo2gKh0931/VldbjQ+F8TgZS6YvzwyLWE/TqZ6LDTnXYHzorO9MGzw4YhK4= diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh new file mode 100755 index 0000000..24378de --- /dev/null +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# This script commits trpl submodule's revision if it has been chaned, and +# pushes the commit to the remote repository. + +set -e + +TRPL_DIR=the-rust-programming-language-ja + +# Get the revision of trpl submodule. +REVISION=$(cd ${TRPL_DIR}; git rev-parse --short HEAD) + +git add ${TRPL_DIR} + +set +e +ret=$(git status | grep -q 'Changes to be committed:'; echo $?) +set -e + +if [ $ret -eq 0 ] ; then + git commit -m "auto commit on travis ${TRAVIS_JOB_NUMBER} [ci skip]\n\nupdate trpl submodule to ${REVISION}." + echo "Comitting trpl submodule's new revision ${REVISION}." + git push origin master +else + echo "There is no change in trpl submodule. (revision: ${REVISION})" +fi diff --git a/ci-scripts/publish-pdf.sh b/ci-scripts/publish-pdf.sh new file mode 100755 index 0000000..97792c1 --- /dev/null +++ b/ci-scripts/publish-pdf.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# This script checks if this build was performed on the `master` branch, +# and if so, it pushes the PDF files to `origin/gh-pages` branch. + +set -e + +function current_branch() { + local branch + if [ "x_{$EVENT_TYPE}" = "x_pull_request" ]; then + branch=${TRAVIS_PULL_REQUEST_BRANCH} + else + branch=${TRAVIS_BRANCH} + fi + + if [ "x_${branch}" = "x_" ]; then + echo "TRAVIS_*BRANCH variable(s) seem undefined. Could not determin the branch." 1>&2 + return 1 + else + echo ${branch} + return 0 + fi +} + +function push_files_to_gh_pages() { + git fetch origin gh-pages:gh-pages + git stash -u + git checkout gh-pages + rm a4.pdf letter.pdf + git stash pop + git add a4.pdf letter.pdf + git commit -a -m "auto commit on travis $TRAVIS_JOB_NUMBER $TRAVIS_COMMIT [ci skip]" + echo "Pushing the PDF files to gh-pages branch." + git push origin gh-pages:gh-pages +} + +if [ "x_${TRAVIS}" != "x_true" ]; then + echo "Not pushing the PDF files to gh-pages because this script was not triggered by Travis CI." 1>&2 + exit 1 +else + CURRENT_BRANCH=$(current_branch) + if [ "x_${CURRENT_BRANCH}" = "x_master" ]; then + push_files_to_gh_pages + else + echo "Not pushing the PDF files to gh-pages because the current branch ${CURRENT_BRANCH} is not master branch." + fi +fi From bb13709ecdd59194ca8d3422cf68f21f888a3227 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 11:12:24 +0900 Subject: [PATCH 04/18] Brush up the ci-scripts - Fix a bug in commit-trpl-submodule-revision.sh, which tries to push local commit to a wrong remote branch. - Better error handlings in all scripts in ci-scripts directory. --- ci-scripts/commit-trpl-submodule-revision.sh | 44 +++++++++++++------- ci-scripts/common-lib | 34 +++++++++++++++ ci-scripts/publish-pdf.sh | 33 +++++---------- 3 files changed, 75 insertions(+), 36 deletions(-) create mode 100755 ci-scripts/common-lib diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh index 24378de..8042367 100755 --- a/ci-scripts/commit-trpl-submodule-revision.sh +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -2,24 +2,40 @@ # This script commits trpl submodule's revision if it has been chaned, and # pushes the commit to the remote repository. +# +# Requires: `bash` -- because `local` and `pipefail` are used. -set -e +set -u -e -o pipefail + +source ./ci-scripts/common-lib TRPL_DIR=the-rust-programming-language-ja -# Get the revision of trpl submodule. -REVISION=$(cd ${TRPL_DIR}; git rev-parse --short HEAD) +function commit_and_push_trpl_submodule_revision() { + local current_branch + current_branch=$(current_travis_branch) + + # Get the revision of trpl submodule. + local revision + revision=$(cd ${TRPL_DIR}; git rev-parse --short HEAD) + + git add ${TRPL_DIR} + set +e + ret=$(git status | grep -q 'Changes to be committed:'; echo $?) + set -e -git add ${TRPL_DIR} + if [ $ret -eq 0 ] ; then + git commit -m <&2 + ret_code=1 + else + echo ${branch} + ret_code=0 + fi + + eval ${opt_state} + return ${ret_code} +} + +function exit_if_not_ci() { + local opt_state=$(set +o) + set +u + + if [ -z "${TRAVIS+x}" -o "x_${TRAVIS}" != "x_true" ]; then + echo "ERROR: Exiting because this script was not triggered by Travis CI." 1>&2 + exit 1 + fi + + eval ${opt_state} +} diff --git a/ci-scripts/publish-pdf.sh b/ci-scripts/publish-pdf.sh index 97792c1..80f438d 100755 --- a/ci-scripts/publish-pdf.sh +++ b/ci-scripts/publish-pdf.sh @@ -2,27 +2,14 @@ # This script checks if this build was performed on the `master` branch, # and if so, it pushes the PDF files to `origin/gh-pages` branch. +# +# Requires: `bash` -- because `local` and `pipefail` are used. -set -e +set -u -e -o pipefail -function current_branch() { - local branch - if [ "x_{$EVENT_TYPE}" = "x_pull_request" ]; then - branch=${TRAVIS_PULL_REQUEST_BRANCH} - else - branch=${TRAVIS_BRANCH} - fi +source ./ci-scripts/common-lib - if [ "x_${branch}" = "x_" ]; then - echo "TRAVIS_*BRANCH variable(s) seem undefined. Could not determin the branch." 1>&2 - return 1 - else - echo ${branch} - return 0 - fi -} - -function push_files_to_gh_pages() { +function push_pdf_files_to_gh_pages() { git fetch origin gh-pages:gh-pages git stash -u git checkout gh-pages @@ -34,13 +21,15 @@ function push_files_to_gh_pages() { git push origin gh-pages:gh-pages } -if [ "x_${TRAVIS}" != "x_true" ]; then - echo "Not pushing the PDF files to gh-pages because this script was not triggered by Travis CI." 1>&2 +exit_if_not_ci + +if [ -z "${TRAVIS+x}" -o "x_${TRAVIS}" != "x_true" ]; then + echo "ERROR: Not pushing the PDF files to gh-pages because this script was not triggered by Travis CI." 1>&2 exit 1 else - CURRENT_BRANCH=$(current_branch) + CURRENT_BRANCH=$(current_travis_branch) if [ "x_${CURRENT_BRANCH}" = "x_master" ]; then - push_files_to_gh_pages + push_pdf_files_to_gh_pages else echo "Not pushing the PDF files to gh-pages because the current branch ${CURRENT_BRANCH} is not master branch." fi From 9b711c79f30f4c2bf446a529f684fae9e04e3160 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 11:33:13 +0900 Subject: [PATCH 05/18] Fix a bug in commit-trpl-submodule-revision.sh about here document --- ci-scripts/commit-trpl-submodule-revision.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh index 8042367..1de4a07 100755 --- a/ci-scripts/commit-trpl-submodule-revision.sh +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -25,12 +25,15 @@ function commit_and_push_trpl_submodule_revision() { set -e if [ $ret -eq 0 ] ; then - git commit -m < Date: Sun, 16 Jul 2017 12:09:01 +0900 Subject: [PATCH 06/18] Update ci-scripts - Fix a bug in commit-trpl-submodule-revision.sh about here document. - Save and restore only the state of nounset option. --- ci-scripts/commit-trpl-submodule-revision.sh | 6 +++--- ci-scripts/common-lib | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh index 1de4a07..d07301c 100755 --- a/ci-scripts/commit-trpl-submodule-revision.sh +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -28,12 +28,12 @@ function commit_and_push_trpl_submodule_revision() { echo "Committing trpl submodule's new revision ${revision}." local commit_message; commit_message=$(cat < Date: Sun, 16 Jul 2017 12:53:14 +0900 Subject: [PATCH 07/18] Update `git push` to use the ssh url for remote repository --- ci-scripts/commit-trpl-submodule-revision.sh | 2 +- ci-scripts/common-lib | 4 ++++ ci-scripts/publish-pdf.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh index d07301c..ac6066b 100755 --- a/ci-scripts/commit-trpl-submodule-revision.sh +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -34,7 +34,7 @@ Update ${TRPL_DIR} submodule to ${revision}. EOF ) git commit -m "${commit_message}" - git push origin ${current_branch}:${current_branch} + git push $(get_remote_ssh_repo_url) ${current_branch}:${current_branch} else echo "There is no change in trpl submodule. (revision: ${revision})" fi diff --git a/ci-scripts/common-lib b/ci-scripts/common-lib index ea13922..5e561f1 100755 --- a/ci-scripts/common-lib +++ b/ci-scripts/common-lib @@ -22,6 +22,10 @@ function current_travis_branch() { return ${ret_code} } +function get_remote_ssh_repo_url() { + echo $(git remote get-url origin | sed -e 's#https://github.com/#git@github.com:#') +} + function exit_if_not_ci() { local opt_u_state [ -o nounset ] && opt_u_state='set -u' || opt_u_state='set +u' diff --git a/ci-scripts/publish-pdf.sh b/ci-scripts/publish-pdf.sh index 80f438d..9c3068b 100755 --- a/ci-scripts/publish-pdf.sh +++ b/ci-scripts/publish-pdf.sh @@ -18,7 +18,7 @@ function push_pdf_files_to_gh_pages() { git add a4.pdf letter.pdf git commit -a -m "auto commit on travis $TRAVIS_JOB_NUMBER $TRAVIS_COMMIT [ci skip]" echo "Pushing the PDF files to gh-pages branch." - git push origin gh-pages:gh-pages + git push $(get_remote_ssh_repo_url) gh-pages:gh-pages } exit_if_not_ci From 4ab12d04cfabe85476f87848cb726df82b1e2d23 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 13:38:35 +0900 Subject: [PATCH 08/18] Update ci-scripts - Run `git checkout` before committing a branch. - More informative messages for pushing to remote git repositories. --- ci-scripts/commit-trpl-submodule-revision.sh | 6 +++++- ci-scripts/publish-pdf.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh index ac6066b..86ff1c4 100755 --- a/ci-scripts/commit-trpl-submodule-revision.sh +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -19,6 +19,7 @@ function commit_and_push_trpl_submodule_revision() { local revision revision=$(cd ${TRPL_DIR}; git rev-parse --short HEAD) + git checkout ${current_branch} git add ${TRPL_DIR} set +e ret=$(git status | grep -q 'Changes to be committed:'; echo $?) @@ -34,7 +35,10 @@ Update ${TRPL_DIR} submodule to ${revision}. EOF ) git commit -m "${commit_message}" - git push $(get_remote_ssh_repo_url) ${current_branch}:${current_branch} + local remote_url + remote_url=$(get_remote_ssh_repo_url) + echo "Pushing to ${current_branch} branch of ${remote_url}." + git push ${remote_url} ${current_branch}:${current_branch} else echo "There is no change in trpl submodule. (revision: ${revision})" fi diff --git a/ci-scripts/publish-pdf.sh b/ci-scripts/publish-pdf.sh index 9c3068b..ac4a52e 100755 --- a/ci-scripts/publish-pdf.sh +++ b/ci-scripts/publish-pdf.sh @@ -17,7 +17,7 @@ function push_pdf_files_to_gh_pages() { git stash pop git add a4.pdf letter.pdf git commit -a -m "auto commit on travis $TRAVIS_JOB_NUMBER $TRAVIS_COMMIT [ci skip]" - echo "Pushing the PDF files to gh-pages branch." + echo "Pushing the PDF files to gh-pages branch of ${remote_url}." git push $(get_remote_ssh_repo_url) gh-pages:gh-pages } From c9af01af8ac6731aee71cba8588654135377f0a8 Mon Sep 17 00:00:00 2001 From: Yoshimura Yuu Date: Sun, 16 Jul 2017 04:46:45 +0000 Subject: [PATCH 09/18] auto commit on travis 12.1 [ci skip] Update the-rust-programming-language-ja submodule to fb31d86. --- the-rust-programming-language-ja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/the-rust-programming-language-ja b/the-rust-programming-language-ja index c8cc4f7..fb31d86 160000 --- a/the-rust-programming-language-ja +++ b/the-rust-programming-language-ja @@ -1 +1 @@ -Subproject commit c8cc4f7e7c5a7af3cebb23bd6b6e8d0b92269e7f +Subproject commit fb31d86640c01c08ab12438a7869353ed8baf757 From 2359f69bc8e386c88272d69c9b2ab0b2ca89763b Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 13:50:11 +0900 Subject: [PATCH 10/18] Revert "auto commit on travis 12.1 [ci skip]" This reverts commit c9af01af8ac6731aee71cba8588654135377f0a8. --- the-rust-programming-language-ja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/the-rust-programming-language-ja b/the-rust-programming-language-ja index fb31d86..c8cc4f7 160000 --- a/the-rust-programming-language-ja +++ b/the-rust-programming-language-ja @@ -1 +1 @@ -Subproject commit fb31d86640c01c08ab12438a7869353ed8baf757 +Subproject commit c8cc4f7e7c5a7af3cebb23bd6b6e8d0b92269e7f From 0c8ba70fd5aa68dca052927a5f70ab4258e2a198 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 15:06:38 +0900 Subject: [PATCH 11/18] Add a missing shell variable to ci-scripts/publish-pdf.sh --- ci-scripts/publish-pdf.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci-scripts/publish-pdf.sh b/ci-scripts/publish-pdf.sh index ac4a52e..29ea75e 100755 --- a/ci-scripts/publish-pdf.sh +++ b/ci-scripts/publish-pdf.sh @@ -17,8 +17,10 @@ function push_pdf_files_to_gh_pages() { git stash pop git add a4.pdf letter.pdf git commit -a -m "auto commit on travis $TRAVIS_JOB_NUMBER $TRAVIS_COMMIT [ci skip]" + local remote_url + remote_url=$(get_remote_ssh_repo_url) echo "Pushing the PDF files to gh-pages branch of ${remote_url}." - git push $(get_remote_ssh_repo_url) gh-pages:gh-pages + git push ${remote_url} gh-pages:gh-pages } exit_if_not_ci From e8e1a510d0f133bb9810725d2668368d1aba9cd9 Mon Sep 17 00:00:00 2001 From: Yoshimura Yuu Date: Sun, 16 Jul 2017 06:13:09 +0000 Subject: [PATCH 12/18] auto commit on travis 15.1 [ci skip] Update the-rust-programming-language-ja submodule to fb31d86. --- the-rust-programming-language-ja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/the-rust-programming-language-ja b/the-rust-programming-language-ja index c8cc4f7..fb31d86 160000 --- a/the-rust-programming-language-ja +++ b/the-rust-programming-language-ja @@ -1 +1 @@ -Subproject commit c8cc4f7e7c5a7af3cebb23bd6b6e8d0b92269e7f +Subproject commit fb31d86640c01c08ab12438a7869353ed8baf757 From e6efe2194caf9174fe12290894b3c1de8aa88dcb Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 15:31:06 +0900 Subject: [PATCH 13/18] Revert "auto commit on travis 15.1 [ci skip]" This reverts commit e8e1a510d0f133bb9810725d2668368d1aba9cd9. --- the-rust-programming-language-ja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/the-rust-programming-language-ja b/the-rust-programming-language-ja index fb31d86..c8cc4f7 160000 --- a/the-rust-programming-language-ja +++ b/the-rust-programming-language-ja @@ -1 +1 @@ -Subproject commit fb31d86640c01c08ab12438a7869353ed8baf757 +Subproject commit c8cc4f7e7c5a7af3cebb23bd6b6e8d0b92269e7f From 1b7c4c5f1b1ab52d378a0b05240d2ba5cc24dec6 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 15:42:48 +0900 Subject: [PATCH 14/18] Revert "Replace deploy_key.enc for tatsuya6502/trpl-ja-pdf repository" This reverts commit d90e5db359ddbbc2b84a2be82649540b763876c9. Conflicts: .travis.yml --- .travis.yml | 4 +-- deploy_key.enc | 72 +++++++++++++++++++++++++------------------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.travis.yml b/.travis.yml index 257f17d..6055aa6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,5 +47,5 @@ after_success: - ./ci-scripts/publish-pdf.sh env: global: - # This is for tatsuya6502/trpl-ja-pdf repo. - secure: e2ePFDSK4MWsMQUidQKS7sbbNYqwJTE1Piie3qQlcPupyMv6T1dNpoB1V4P6aRfekJL+5uQrSFel3ZM2Huiskf8FCI5WLomek97tgfUNVkUAb1HxNAhtwziQU8sTbGMGc52hHlICLiuWYpEeWplFjYAur+Z/20BTbyoP7ajCJqUwc+ZjcxzshGOv+fGSClYu8MhJg4l3yfQpnaOon+2XPk41AI1WdhTOK6IT3L1l7tKo2Vk/k6sYQdfyBNdWWl1rpeddNpwwLVUFr2muzbs2Q0X2r2PCQigj/uXsk80VcDCMOwYdWZRafuZfa7KwHWQGJXsiHxA7Pq3zTZMQRGUzljJjugytl4g55EF0+K2xUScpyYfNVYL4SrKdbQDgw6PGtNYGxNP+DwaLBWTNigin9bCqSkYg3I2L/tqsLH166SRzsq6y/QHvwno8Q8TaTz3uDWR/22d2why3nvFf+neHn+GVG1Cjw6/2L04e+mpgeBgxDz5vjXh2JYvMV1/8squgn33GiDOA00MZFkk8nSUxGzhEqOjAY2tVquW5ReeddL9zq2NCNNTHIjtVM51eHAEuJ/VpSUb4e/vqkDIYGouKHHRfvYlwnONSOksHZ4PqZ6kNGL/Dqo2gKh0931/VldbjQ+F8TgZS6YvzwyLWE/TqZ6LDTnXYHzorO9MGzw4YhK4= + secure: ck1uVFgjw0jFayZgV9enDV3n4/D5PiyW3J/ahpHHhTaO9H4tGl6vKzlsbbo9zCPRmYpHyjH/mnEDcfWXViRE72o4wYxA4zbK+JNzJK5mFUuSZB4WrD44HC9jIL99u3mLU+9DnlK6gbE3oz6JRI04Ie9L48+LeCAX6HS4iAuj8ddRIgkVUEKoZPhJ7AbFNcBtU91uQqRmpLWXeLKgkwC9jSmD//zC0DkdTHGoCD2aUCARiwBbWLn17oV8nI37eUEgV/ZaPDmwoV1JSR9KFiokWTH4QiRwwKXnw5n2nHJPmBCmEs5LmQlsuu8puZmlXg6m8xUTIheW0vTbxejZeoNP71M+7MXGP0Ix6Z1rDrx767GORjUpwhSgVwmrz7VCSgZYwze9v2j0NWsDaDXD4kruxF4j7c7YdhzPA/+K6I+NdwVE3zGyRzG6KUySbVXGAFIMzIt/yofTN1PeSy779nrnMiNI9N8AyikYmiT1ocT91j7HzMYTab250yugm6Tl80+wwlpbk0ljYR7m0ZBIopAS8HzzeSrD9Qww6PAQ9EBPvnIlhG62ttUAjRFHe7zrDSzWaD2WvdM+jmeEGCdc1iqQLteWgvsLbXOJd5GJksOgRX/rRa++ioq2/+P/aGEyFeNXWMD3ru2V3eDDL2kBpnLv93JmsdRorGsFDOFsau2i0TI= + diff --git a/deploy_key.enc b/deploy_key.enc index 794f9be..6140d5d 100644 --- a/deploy_key.enc +++ b/deploy_key.enc @@ -1,36 +1,36 @@ -U2FsdGVkX1+fADGyfDXdDR0X0LOOULR6inXmLJIepEybOmlvInMtzCaOHX80NYwd -hC1mn8KasjL4wYpPAwwOijJO3id9f92dv+Mw8V3bkVmVdtTyXOkHaEYGMZpeHDAa -yF9vDo7a+rF5xnP4MKZoj4K9hhuvyvXU1wIk7MU6B4k2KRWr3VxAFsfcn2mZ7l8C -PLTVp+0dnSPmexqeuUzSTwVWVVz752+HDmV7tIcdyxIWh64soNNaJs6O3zSjX1zf -R82VdJ4QhW9hIx0jG3K052NPHqOT+HlD8+B942KCAEU6zLg9zlkJlV2A2xxKJ9h8 -rLpHz2hHk9e4jV3A9k4j8f0k3wRTaw2rqndFXDPcDUiJ2kN7WJrKmBqqUXCKUVKd -1icqXYc7ksBsmKJmEKalILyrMgrDfOBcYd8VJ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AUeQIB4oFsjFk7 +jOkQyW42vAMmqbcnSdGRMs+OeK2OYL16jUdiYSM60PRykiNteBO/AcWEoTvGq5MJ +DBgnb41NR/zjdfnFKUq93MdXsmnugW/gNUl6CDa+n97rxr2r0+kpLkly0Fcelo29 +IVthXqFOpj2+GTf1GWEhGYvrjPFgrSxuzSg6or9xbfuHBiwkS1QXHGmoc0fFc7JR +UNOCD9pbqENyDKykf70HADTKbEyM/mRG+fV/G+eXp6Dr8apTm76XoZpV8senqQtq +8FvlID/upPAWFS0rVGtTt4llDVj9DqKa/k054m+gQptxcPzBa5vwjIjEqDCs8jiE +suIagYIwl1zvIjFil+ovm8NKZEkRYbfIvFqVEzhqm5AhXMXva7AAJucSctbKtObw ++UtJePa4R2SWLN8QrEhtrSzhCx43fDJsoM1oEtragP/o1UB44r/8iBHEZTQfj4M1 +zxG95NWj/1BtTBcCYfr0AYpAyxch9ORe3tbOfzTql5YQYs63z4c7lpvS76GVBQ0G +G8MIdS1wiIAENz+HTtOsYYHJEtkIvWGrcRriYuFsfJVveZ3ivME1qZZGjZfJA3yY +Hx/OGgbmnKY4ADT1soOjpO+zf30bEA3m/8C/VqXcw+ckkXcp9Po0IKhBVS6X5yWX +Sd3ojyQ0Ixx/aXL96SwF4+qGEI3zX6hsHOfVxZPhEeU56KboUh/NCh9SOwP62hWl +UIv30yS8O7V6xCM4qERLlxTUnkhofx1ST9hvYw7CJSFsKW9exG85fyYO0LKD7j4T +M9X/t9MknhIbJN3/JELLXUJ+uqb6ihl/5F/FygCaSzw+WEbDZUfmg78NHJ4TVE0B +1XvU/1GzKcKVs1kY63VUssckAvQ81hbA6klHGuNtb0Ojs67Llcw+iR1MD6P9CEtk +qMe91KJeMloYD+akg80u6Q== From 9ad6d1a0394aaa086616cf091adcca7b06581045 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 15:46:15 +0900 Subject: [PATCH 15/18] Fix typos in ci-scripts Also remove an extra new-line at the bottom of .travis --- .travis.yml | 1 - ci-scripts/commit-trpl-submodule-revision.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6055aa6..ad88466 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,4 +48,3 @@ after_success: env: global: secure: ck1uVFgjw0jFayZgV9enDV3n4/D5PiyW3J/ahpHHhTaO9H4tGl6vKzlsbbo9zCPRmYpHyjH/mnEDcfWXViRE72o4wYxA4zbK+JNzJK5mFUuSZB4WrD44HC9jIL99u3mLU+9DnlK6gbE3oz6JRI04Ie9L48+LeCAX6HS4iAuj8ddRIgkVUEKoZPhJ7AbFNcBtU91uQqRmpLWXeLKgkwC9jSmD//zC0DkdTHGoCD2aUCARiwBbWLn17oV8nI37eUEgV/ZaPDmwoV1JSR9KFiokWTH4QiRwwKXnw5n2nHJPmBCmEs5LmQlsuu8puZmlXg6m8xUTIheW0vTbxejZeoNP71M+7MXGP0Ix6Z1rDrx767GORjUpwhSgVwmrz7VCSgZYwze9v2j0NWsDaDXD4kruxF4j7c7YdhzPA/+K6I+NdwVE3zGyRzG6KUySbVXGAFIMzIt/yofTN1PeSy779nrnMiNI9N8AyikYmiT1ocT91j7HzMYTab250yugm6Tl80+wwlpbk0ljYR7m0ZBIopAS8HzzeSrD9Qww6PAQ9EBPvnIlhG62ttUAjRFHe7zrDSzWaD2WvdM+jmeEGCdc1iqQLteWgvsLbXOJd5GJksOgRX/rRa++ioq2/+P/aGEyFeNXWMD3ru2V3eDDL2kBpnLv93JmsdRorGsFDOFsau2i0TI= - diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh index 86ff1c4..e716b99 100755 --- a/ci-scripts/commit-trpl-submodule-revision.sh +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This script commits trpl submodule's revision if it has been chaned, and +# This script commits trpl submodule's revision if it has been changed, and # pushes the commit to the remote repository. # # Requires: `bash` -- because `local` and `pipefail` are used. From d4593d57af1ffb6486c0de9043138fbaca45890f Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Sun, 16 Jul 2017 15:51:26 +0900 Subject: [PATCH 16/18] Update ci-scripts: make some variables local --- ci-scripts/commit-trpl-submodule-revision.sh | 1 + ci-scripts/common-lib | 1 + 2 files changed, 2 insertions(+) diff --git a/ci-scripts/commit-trpl-submodule-revision.sh b/ci-scripts/commit-trpl-submodule-revision.sh index e716b99..2ca79a6 100755 --- a/ci-scripts/commit-trpl-submodule-revision.sh +++ b/ci-scripts/commit-trpl-submodule-revision.sh @@ -21,6 +21,7 @@ function commit_and_push_trpl_submodule_revision() { git checkout ${current_branch} git add ${TRPL_DIR} + local ret set +e ret=$(git status | grep -q 'Changes to be committed:'; echo $?) set -e diff --git a/ci-scripts/common-lib b/ci-scripts/common-lib index 5e561f1..b88841f 100755 --- a/ci-scripts/common-lib +++ b/ci-scripts/common-lib @@ -10,6 +10,7 @@ function current_travis_branch() { branch=${TRAVIS_BRANCH} fi + local ret_code if [ "x_${branch}" = "x_" ]; then echo "ERROR: TRAVIS_*BRANCH variable(s) seem undefined. Could not get the branch info." 1>&2 ret_code=1 From 7ca64b02cbe911ede478fb8e068eff29252ce4b8 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Tue, 18 Jul 2017 10:38:38 +0900 Subject: [PATCH 17/18] Fix a bug in common-lib current_travis_branch() `$EVENT_TYPE` should read `$TRAVIS_EVENT_TYPE`. --- ci-scripts/common-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/common-lib b/ci-scripts/common-lib index b88841f..1d2a0f2 100755 --- a/ci-scripts/common-lib +++ b/ci-scripts/common-lib @@ -4,7 +4,7 @@ function current_travis_branch() { set +u local branch - if [ "x_{$EVENT_TYPE}" = "x_pull_request" ]; then + if [ "x_{$TRAVIS_EVENT_TYPE}" = "x_pull_request" ]; then branch=${TRAVIS_PULL_REQUEST_BRANCH} else branch=${TRAVIS_BRANCH} From d6c3886a0523040dee935977dcb9894c3c708862 Mon Sep 17 00:00:00 2001 From: Tatsuya Kawano Date: Fri, 21 Jul 2017 09:49:24 +0900 Subject: [PATCH 18/18] Enhancements based on the review on PR #6 - Remove duplicate codes from publish-pdf.sh. - Remove unnecessary `git fetch`. --- .travis.yml | 2 +- ci-scripts/publish-pdf.sh | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad88466..de5bab6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ install: - ./tlmgr.sh update --self --all || echo "ignore errors" - ./tlmgr.sh install collection-luatex collection-langjapanese collection-fontsrecommended type1cm mdframed needspace hyphenat quotchap framed everyhook svn-prov before_script: - - (cd the-rust-programming-language-ja && git fetch origin && git checkout master && git pull origin master) + - (cd the-rust-programming-language-ja && git checkout master && git pull origin master) - cp trpl_meta.yml trpl-ebook/ - "echo \"pub const RELEASE_DATE: &'static str = \\\"`date +%F`\\\";\" | cat - options.rs.template > options.rs" - cp options.rs trpl-ebook/src/convert_book/ diff --git a/ci-scripts/publish-pdf.sh b/ci-scripts/publish-pdf.sh index 29ea75e..e6ae304 100755 --- a/ci-scripts/publish-pdf.sh +++ b/ci-scripts/publish-pdf.sh @@ -25,14 +25,9 @@ function push_pdf_files_to_gh_pages() { exit_if_not_ci -if [ -z "${TRAVIS+x}" -o "x_${TRAVIS}" != "x_true" ]; then - echo "ERROR: Not pushing the PDF files to gh-pages because this script was not triggered by Travis CI." 1>&2 - exit 1 +CURRENT_BRANCH=$(current_travis_branch) +if [ "x_${CURRENT_BRANCH}" = "x_master" ]; then + push_pdf_files_to_gh_pages else - CURRENT_BRANCH=$(current_travis_branch) - if [ "x_${CURRENT_BRANCH}" = "x_master" ]; then - push_pdf_files_to_gh_pages - else - echo "Not pushing the PDF files to gh-pages because the current branch ${CURRENT_BRANCH} is not master branch." - fi + echo "Not pushing the PDF files to gh-pages because the current branch ${CURRENT_BRANCH} is not master branch." fi