LoginSignup
1
1

More than 5 years have passed since last update.

TravisCIで新しいMongoDBを使う

Posted at

通常、TravisCIでMongoDBを使う場合、以下のようにtravis.ymlに記述する。

travis.yml
services:
  - mongodb

しかしここで利用可能になるmongoDBのバージョンは2017年5月現在で2.4.12になっている。

image.png

新しいバージョン(ここでは3.2を利用する)を使いたい場合には以下の記事の通り、travis.ymlを書き換えるとうまくいった。
install newer version of MongoDB

.travis.yml
-services: mongodb
+addons:
+  apt:
+    sources:
+      - mongodb-upstart
+      - mongodb-3.2-precise
+    packages:
+      - mongodb-org-server
+      - mongodb-org-shell

この変更だけでmongodのサービスも起動するようになる。

ビルド内でバージョンを確認したところ、ちゃんと3.2系が使われていることが確認できた。

image.png

1
1
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
1
1