Top Level Namespace
Defined Under Namespace
Modules: Capistrano
Instance Method Summary collapse
-
#airbrake ⇒ Object
Tasks.
-
#database ⇒ Object
Tasks.
-
#deploy ⇒ Object
Tasks.
-
#logs ⇒ Object
Tasks.
-
#mongoid ⇒ Object
Tasks.
-
#rails ⇒ Object
Tasks.
-
#rails2 ⇒ Object
Tasks.
-
#remote ⇒ Object
Dependencies.
- #run_interactively(command, server = nil) ⇒ Object
-
#s3 ⇒ Object
Tasks.
-
#scm ⇒ Object
Default configuration.
-
#sunspot ⇒ Object
Tasks.
-
#thinking_sphinx ⇒ Object
Tasks.
-
#ts ⇒ Object
Alias for thinking_sphinx namespace.
-
#unicorn_binary ⇒ Object
Unicorn Config.
-
#user ⇒ Object
Default app configuration.
-
#whenever_command ⇒ Object
Whenever.
Instance Method Details
#airbrake ⇒ Object
Tasks
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/capistrano/novelys/airbrake.rb', line 8 namespace :airbrake do desc "Copy airbrake API Key" task :copy do upload "config/initializers/airbrake.rb", "#{shared_path}/config/initializers/airbrake.rb", :via => :scp end desc "Link the config/initializers/airbrake.rb file in the release_path" task :symlink do run "test -f #{release_path}/config/initializers/airbrake.rb || ln -s #{shared_path}/config/initializers/airbrake.rb #{release_path}/config/initializers/airbrake.rb" end end |
#database ⇒ Object
Tasks
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/capistrano/novelys/database.rb', line 5 namespace :database do desc "Database create" task :create do run "cd #{current_path} && #{bundle_cmd} exec rake db:create:all" end desc "Database seeds population" task :seed do run "cd #{current_path} && #{bundle_cmd} exec rake db:seed" end desc "Copy database config" task :copy do upload "config/database.yml", "#{shared_path}/config/database.yml", :via => :scp end desc "Link the config/database.yml file in the release_path" task :symlink do run "test -f #{release_path}/config/database.yml || ln -s #{shared_path}/config/database.yml #{release_path}/config/database.yml" end end |
#deploy ⇒ Object
Tasks
29 30 31 32 33 34 |
# File 'lib/capistrano/novelys/core.rb', line 29 namespace :deploy do desc "Create directories required for correct symlinking" task :mkdir_config do run "mkdir -p #{shared_path}/config/initializers" end end |
#logs ⇒ Object
Tasks
2 3 4 5 6 7 |
# File 'lib/capistrano/novelys/logs.rb', line 2 namespace :logs do desc "Tail Rails logs" task :tail do stream "tail -f #{shared_path}/log/#{rails_env}.log" end end |
#mongoid ⇒ Object
Tasks
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/capistrano/novelys/mongoid.rb', line 5 namespace :mongoid do desc "Copy mongoid config" task :copy do upload "config/mongoid.yml", "#{shared_path}/config/mongoid.yml", :via => :scp end desc "Link the mongoid config in the release_path" task :symlink do run "test -f #{release_path}/config/mongoid.yml || ln -s #{shared_path}/config/mongoid.yml #{release_path}/config/mongoid.yml" end desc "Create MongoDB indexes" task :index do run "cd #{current_path} && #{bundle_cmd} exec rake db:mongoid:create_indexes", :once => true end end |
#rails ⇒ Object
Tasks
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/capistrano/novelys/rails.rb', line 7 namespace :rails do namespace :secret_token do desc "Copy the secret token file to the server" task :copy do upload "config/initializers/secret_token.rb", "#{shared_path}/config/initializes/secret_token.rb", :via => :scp end desc "Symlink the secret token file in the current release" task :symlink do run "test -f #{release_path}/config/initializers/secret_token.rb || ln -s #{shared_path}/config/initializers/secret_token.rb #{release_path}/config/initializers/secret_token.rb" end end desc "Open a Rails console" task :console do run_interactively "bundle exec rails console #{rails_env}" end desc "Open a DBConsole" task :dbconsole do run_interactively "bundle exec rails dbconsole #{rails_env}" end end |
#rails2 ⇒ Object
Tasks
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/capistrano/novelys/rails2.rb', line 7 namespace :rails2 do namespace :secret_token do desc "Copy the secret token file to the server" task :copy do upload "config/initializers/session_store.rb", "#{shared_path}/config/initializes/session_store.rb", :via => :scp end desc "Symlink the secret token file in the current release" task :symlink do run "test -f #{release_path}/initializers/session_store.rb || ln -s #{shared_path}/initializers/session_store.rb #{release_path}/initializers/session_store.rb" end end desc "Open a Rails console" task :console do run_interactively "bundle exec script/console #{rails_env}" end desc "Open a DBConsole" task :dbconsole do run_interactively "bundle exec script/dbconsole #{rails_env}" end end |
#remote ⇒ Object
Dependencies
2 |
# File 'lib/capistrano/novelys/core.rb', line 2 depend :remote, :command, 'git' |
#run_interactively(command, server = nil) ⇒ Object
31 32 33 34 |
# File 'lib/capistrano/novelys/rails.rb', line 31 def run_interactively(command, server = nil) server ||= find_servers_for_task(current_task).first exec %Q(ssh #{user}@#{server.host} -t 'cd #{current_path} && #{command}') end |
#s3 ⇒ Object
Tasks
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/capistrano/novelys/s3.rb', line 5 namespace :s3 do desc "Copy amazon S3 config" task :copy do upload "config/amazon_s3.yml", "#{shared_path}/config/amazon_s3.yml", :via => :scp end desc "Link the config/amazon_s3.yml file in the release_path" task :symlink do run "test -f #{release_path}/config/amazon_s3.yml || ln -s #{shared_path}/config/amazon_s3.yml #{release_path}/config/amazon_s3.yml" end end |
#scm ⇒ Object
Default configuration
5 |
# File 'lib/capistrano/novelys/core.rb', line 5 set(:scm) { :git } |
#sunspot ⇒ Object
Tasks
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/capistrano/novelys/sunspot.rb', line 5 namespace :sunspot do desc "Copy sunspot config" task :copy do upload "config/sunspot.yml", "#{shared_path}/config/sunspot.yml", :via => :scp end desc "Link the config/sunspot.yml file in the release_path" task :symlink do run "test -f #{release_path}/config/sunspot.yml || ln -s #{shared_path}/config/sunspot.yml #{release_path}/config/sunspot.yml" end end |
#thinking_sphinx ⇒ Object
Tasks
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/capistrano/novelys/sphinx.rb', line 6 namespace :thinking_sphinx do desc "Copy local sphinx config" task :copy do upload "config/development.sphinx.conf", "#{shared_path}/config/#{rails_env}.sphinx.conf", :via => :scp end desc "Link the config/*.sphinx.conf file in the release_path" task :symlink do run "test -f #{release_path}/config/#{rails_env}.sphinx.conf || ln -s #{shared_path}/config/#{rails_env}.sphinx.conf #{release_path}/config/#{rails_env}.sphinx.conf" end end |
#ts ⇒ Object
Alias for thinking_sphinx namespace
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/capistrano/novelys/sphinx.rb', line 19 namespace :ts do desc "Generate the Sphinx configuration file" task(:configure) { thinking_sphinx.configure } desc "Index data" task(:index) { thinking_sphinx.index } desc "Stop, re-index and then start the Sphinx daemon" task(:rebuild) { thinking_sphinx.rebuild } desc "Stop and then start the Sphinx daemon" task(:restart) { thinking_sphinx.restart } desc "Add the shared folder for sphinx files for the production environment" task(:shared_sphinx_folder) { thinking_sphinx.shared_sphinx_folder } desc "Start the Sphinx daemon" task(:start) { thinking_sphinx.start } desc "Stop the Sphinx daemon" task(:stop) { thinking_sphinx.stop } desc "Copy local sphinx config" task(:copy) { thinking_sphinx.copy } desc "Link the config/*.sphinx.conf file in the release_path" task(:symlink) { thinking_sphinx.symlink } end |
#unicorn_binary ⇒ Object
Unicorn Config
2 |
# File 'lib/capistrano/novelys/unicorn.rb', line 2 set(:unicorn_binary) { 'bundle exec unicorn_rails' } |
#user ⇒ Object
Default app configuration
15 |
# File 'lib/capistrano/novelys/core.rb', line 15 set(:user) { application } |
#whenever_command ⇒ Object
Whenever
4 |
# File 'lib/capistrano/novelys/whenever.rb', line 4 set(:whenever_command) { 'bundle exec whenever' } |