You are here: Home Tech Build MongoDB on FreeBSD -- for Jenkins use

Build MongoDB on FreeBSD -- for Jenkins use

by Chris Shenton last modified Aug 19, 2011 05:42 PM
We use Jenkins to automate build and test; many of our projects use MongoDB, so we need a download tarball for it as 10gen doesn't offer a pre-built image.

The 10gen folks behind MongoDB don't provide a prebuilt image of MongoDB and its binaries for FreeBSD, so we build our own. We then put up the tarball somewhere that our Jenkins build/test system can find it. 

We only need the binaries under bin/, e.g.:

$ tar ztf mongodb-freebsd7-x86_64-1.8.1.tgz 
mongodb-freebsd7-x86_64-1.8.1/
mongodb-freebsd7-x86_64-1.8.1/bin/
mongodb-freebsd7-x86_64-1.8.1/bin/mongofiles
mongodb-freebsd7-x86_64-1.8.1/bin/mongod
mongodb-freebsd7-x86_64-1.8.1/bin/mongodump
mongodb-freebsd7-x86_64-1.8.1/bin/mongorestore
mongodb-freebsd7-x86_64-1.8.1/bin/mongos
mongodb-freebsd7-x86_64-1.8.1/bin/mongo
mongodb-freebsd7-x86_64-1.8.1/bin/mongostat
mongodb-freebsd7-x86_64-1.8.1/bin/mongosniff
mongodb-freebsd7-x86_64-1.8.1/bin/mongoexport
mongodb-freebsd7-x86_64-1.8.1/bin/bsondump
mongodb-freebsd7-x86_64-1.8.1/bin/mongoimport

FreeBSD ports maintainers keep pretty current so we build from there:

cd /usr/ports/databases/mongodb
sudo make
sudo make installmkdir -p /tmp/mongodb-freebsd8_64_1.8.2/bin
cp /usr/local/bin/mongo* /usr/local/bin/bsondump /tmp/mongodb-freebsd8_64_1.8.2/bin/tar cf /usr/local/www/apache22/data/koansys.com/static/mongodb-freebsd8-x86_64-1.8.2.tgz mongodb-freebsd8_64_1.8.2

Now you should be able to use it in your own buildouts.

Here's the MongoDB-1.8.2 I just built for FreeBSD-8 64bit.

Share this: