-
Notifications
You must be signed in to change notification settings - Fork 1
サブモジュール "the-rust-programming-language-ja" の自動更新 #6
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
base: master
Are you sure you want to change the base?
サブモジュール "the-rust-programming-language-ja" の自動更新 #6
Conversation
- 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.
- Fix a bug in commit-trpl-submodule-revision.sh about here document. - Save and restore only the state of nounset option.
- Run `git checkout` before committing a branch. - More informative messages for pushing to remote git repositories.
Update the-rust-programming-language-ja submodule to fb31d86.
This reverts commit c9af01a.
Update the-rust-programming-language-ja submodule to fb31d86.
This reverts commit e8e1a51.
This reverts commit d90e5db. Conflicts: .travis.yml
Also remove an extra new-line at the bottom of .travis
`$EVENT_TYPE` should read `$TRAVIS_EVENT_TYPE`.
@tatsuya6502 さん。 ありがとうございます。 |
@y-yu さん
はい、そうです。この PR では前者を達成しようとしています。 もちろん、この PR をマージしただけでは不十分で、the-rust-programming-language-ja(trpl-ja)に更新があったことを検知できません。そこで、この後、trpl-ja の Circle CI ジョブに修正を加え、trpl-ja の master ブランチが更新されたときに、こちら(trpl-ja-pdf)の Jenkins CI ジョブを自動起動するようにします。具体的には Travis CI ドキュメントの このページ で解説されている curl コマンドを使った方法を用います。 trpl-ja の Circle CI ジョブの修正は、数日中に行う予定です。(PR を上げた時点でお知らせします) その PR がマージされたら、trpl-ja が更新されるごとに trpl-ja-pdf の Jenkins CI ジョブが起動され、PDF が自動生成されるようになります。 |
@tatsuya6502 さん。 なるほど! 承知しました。 |
こちらですが、 trpl-ja の方へ PR を上げました。 |
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.
2点、指摘させていただきましたので、ご確認をおねがいします。
ci-scripts/publish-pdf.sh
Outdated
|
||
exit_if_not_ci | ||
|
||
if [ -z "${TRAVIS+x}" -o "x_${TRAVIS}" != "x_true" ]; then |
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.
ここでやっていることは、直前にあるexit_if_not_ci
とどう違うのでしょうか?
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.
あ、同じ内容ですね。どうやら編集ミスのようです。最初にこの if
文があったのですが、その後 common-lib に exit_if_not_ci
を作った時に、if
文を削除し忘れたようです。
重複部分を削除しますね。見つけていただいて良かったです。
.travis.yml
Outdated
@@ -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) |
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.
ささいですが、git pull
するならばgit fetch
は必要ないかもしれないです。
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.
たしかにそうですね。git fetch
は削除します。
- Remove duplicate codes from publish-pdf.sh. - Remove unnecessary `git fetch`.
レビュー、ありがとうございました。ご指摘の2点は修正しました。 が、問題が1つあることに気づきました。修正できるか今夜(?)調べますので、まだマージしないでください。 今回、フォークしたリポジトリ(tatsuya6502)のブランチ(auto-update-submodules)で作業しているのですが、PR を上げたままコミットすると、Travis CI のジョブが2つ走るようです。
前者は期待通り動いているのですが、後者はそうではありません。commit-trpl-submodule-revision.sh がサブモジュールの変更を trpl-ja-pdf の master ブランチに commit して、push しようとします。(deploy.key の decrypt ができなかったのか、push には失敗しています) こういう場合には、PR 先のリポジトリでは commit-trpl-submodule-revision.sh は何もしない方がいいと思います。修正できるか調べてみます。 |
承知しました。 |
メモ:テストリポジトリで実施したテスト結果(7/22/2017)
|
Travis による CI 実行時に、サブモジュール "the-rust-programming-language-ja" を最新版に自動更新するように変更します。以前検討した この案 をベースにしています。
現在の CI からの変更点
git pull origin master
し、最新のリビジョンを取得する 。(.travis.yml
ファイルの変更)ci-scripts/commit-trpl-submodule-revision.sh
で実現) なお、その際、コミットメッセージに[ci skip]
の文字列を含めることで、これをトリガーにした新たな CI が起動することを防ぐ。ci-scripts/publish-pdf.sh
で実現)CI 実行例
テストのために、本リポジトリのフォークで CI を実行しました。
@y-yu さん、レビューをお願いします。