Skip to content

Instantly share code, notes, and snippets.

@cihad
Created October 23, 2012 14:45
Show Gist options
  • Save cihad/3939187 to your computer and use it in GitHub Desktop.
Save cihad/3939187 to your computer and use it in GitHub Desktop.
Mongodb Install Capistrano Recipe
# reference: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/
namespace :mongodb do
desc "Install the latest stable release of Mongodb."
task :install, roles: :db, only: { primary: true } do
run "#{sudo} apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10"
run "#{sudo} touch /etc/apt/sources.list.d/10gen.list"
run "#{sudo} echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' >> /etc/apt/sources.list.d/10gen.list"
run "#{sudo} apt-get -y update"
run "#{sudo} apt-get -y install mongodb-10gen"
end
after "deploy:install", "mongodb:install"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment