Sha256: cfaaea83b5289a173218e9e9d8efe3216bef8a77ec39ff1b62df7faff6bc9df2

Contents?: true

Size: 1.39 KB

Versions: 5

Compression:

Stored size: 1.39 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../utilities')
require File.expand_path(File.dirname(__FILE__) + '/manage')

Capistrano::Configuration.instance(true).load do
  set :mongodb_data_path, "/data/db"
  set :mongodb_bin_path, "/opt/mongo"
  
  namespace :mongodb do    
    desc "Installs mongodb binaries and all dependencies"
    task :install, :role => :app do
      utilities.apt_install "tcsh scons g++ libpcre++-dev"
      utilities.apt_install "libboost1.37-dev libreadline-dev xulrunner-dev"
      mongodb.make_spidermonkey
      mongodb.make_mongodb
      mongodb.setup_db_path
    end

    task :make_spidermonkey, :role => :app do
      run "mkdir -p ~/tmp"
      run "cd ~/tmp; wget ftp://ftp.mozilla.org/pub/mozilla.org/js/js-1.7.0.tar.gz"
      run "cd ~/tmp; tar -zxvf js-1.7.0.tar.gz"
      run "cd ~/tmp/js/src; export CFLAGS=\"-DJS_C_STRINGS_ARE_UTF8\""
      run "cd ~/tmp/js/src; #{sudo} make -f Makefile.ref"
      run "cd ~/tmp/js/src; #{sudo} JS_DIST=/usr make -f Makefile.ref export"
    end

    task :make_mongodb, :role => :app do
      sudo "rm -rf ~/tmp/mongo"
      run "cd ~/tmp; git clone git://github.com/mongodb/mongo.git"
      run "cd ~/tmp/mongo; #{sudo} scons all"
      run "cd ~/tmp/mongo; #{sudo} scons --prefix=#{mongodb_bin_path} install"
    end

    task :setup_db_path, :role => :app do
      sudo "mkdir -p #{mongodb_data_path}"
      mongodb.start
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cap-recipes-0.3.39 lib/cap_recipes/tasks/mongodb/install.rb
cap-recipes-0.3.38 lib/cap_recipes/tasks/mongodb/install.rb
cap-recipes-0.3.37 lib/cap_recipes/tasks/mongodb/install.rb
cap-recipes-0.3.36 lib/cap_recipes/tasks/mongodb/install.rb
cap-recipes-0.3.35 lib/cap_recipes/tasks/mongodb/install.rb