-
-
Save masatomo/983a84bad9671dc29213 to your computer and use it in GitHub Desktop.
dependencies: | |
cache_directories: | |
- mongodb-linux-x86_64-2.6.4 | |
pre: | |
- if [[ ! -d mongodb-linux-x86_64-2.6.4 ]]; then wget http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.4.tgz && tar xvzf mongodb-linux-x86_64-2.6.4.tgz; fi | |
- sudo /etc/init.d/mongodb stop | |
- sudo cp mongodb-linux-x86_64-2.6.4/bin/* /usr/bin | |
- sudo /etc/init.d/mongodb start |
I think they also have mongodb included, so you don't have to actually download and install it yourself Simply set this in your circle.yml
file:
machine:
services:
- mongodb
@orcaman It is indeed included but it's an older version, so you don't have stuff like text search.
how can mongo 3.0.x be run on Circle ci?
Here is a mongodb 3.2
version:
cache_directories:
- mongodb-linux-x86_64-ubuntu1204-3.2.0
pre:
- if [[ ! -d mongodb-linux-x86_64-ubuntu1204-3.2.0 ]]; then wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1204-3.2.0.tgz && tar xvzf mongodb-linux-x86_64-ubuntu1204-3.2.0.tgz; fi
- sudo stop mongodb
- sudo cp mongodb-linux-x86_64-ubuntu1204-3.2.0/bin/* /usr/bin
- sudo start mongodb
It may be a bit tricky when you’re deploying via AWS CodeDeploy, because everything that will be put in current directory and declared as cache will also be included/bundled in ZIP archive that will be placed on S3 for further deploy. So you easily will get extra 200 MB in size.
To avoid such issues, it is better to download, unarchive and cache everything on one level higher, in /home/ubuntu
directory. Just use simple ../
directory with proper command arguments:
dependencies:
cache_directories:
- ../mongodb-linux-x86_64-ubuntu1204-3.2.3
pre:
- if [[ ! -d ../mongodb-linux-x86_64-ubuntu1204-3.2.3 ]]; then wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1204-3.2.3.tgz -P ../ && tar xvzf ../mongodb-linux-x86_64-ubuntu1204-3.2.3.tgz -C ../; fi
- sudo stop mongodb
- sudo cp ../mongodb-linux-x86_64-ubuntu1204-3.2.3/bin/* /usr/bin
- sudo start mongodb
- pip install asynctest
👍