LoginSignup
7
6

More than 5 years have passed since last update.

Travis CIでPull Requestではなく、デフォルトブランチのみでコマンドを実行する

Posted at

Pull Requestではなく、デフォルトブランチ(特定のブランチ)でのみコマンドを実行するパターン。

test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && したいこと

例えば、デプロイ系のやつをTravisでやりたい場合、Pull Requestとかで行われると困ったりする。

after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "gh-pages" && deploy

みたいな感じでやったりする。

デフォルトブランチの取得ってコマンドでできるのかな?(デフォルトブランチという概念があるのかよくわからないけど)


.travis.ymlBuilding Specific BranchesだとPull RequestでTravisが動かなくなる。

Travisのdeploy機能に対応してるサービスはon:でブランチしていできるのでそもそも問題なさそう。

7
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6