LoginSignup
6
5

More than 5 years have passed since last update.

CircleCIで、Pull Requestのビルドを「masterにためしにマージして」やる

Posted at

Circle CIでは、「Pull Requestをマージ前に動作確認をする」といったことは自分でconfigにかいてあげないとできません。
(参考→TravisCIとCircleCIでちょっとずつ違うビルド環境の考え方の違い

そこで、Pre-dependency commands

マージ
git checkout origin/master
git merge origin/$CIRCLECI_BRANCH
git submodule init && git submodule update

って書けばいいや、とおもったら、そうはいかなかったのでメモ。

なぜかコンフリクトが起きます。
SSHで入って、手でGitリポジトリから取得して↑を打つとコンフリクトは起きません。
CircleCIがcloneしたリポジトリは、単純なcloneではないようです。

いろいろ試したんですが、とりあえず結論だけ。

むりやり回避
git clone git@github.com/crowdworks/hoge_project -b $CIRCLECI_BRANCH
rm -rf .git
mv hoge_project/.git .git

git checkout origin/master
git merge origin/$CIRCLECI_BRANCH
git submodule init && git submodule update

のように、gitファイルをむりやり書き換えてやれば、マージができるようになりました。

6
5
0

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
6
5