Class: Nodex::Deploy
- Inherits:
-
Object
- Object
- Nodex::Deploy
- Defined in:
- lib/nodex/deploy.rb
Instance Attribute Summary collapse
-
#application ⇒ Object
Returns the value of attribute application.
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#cache_dirs ⇒ Object
Returns the value of attribute cache_dirs.
-
#db_example_name ⇒ Object
Returns the value of attribute db_example_name.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#host ⇒ Object
Returns the value of attribute host.
-
#login_shell ⇒ Object
Returns the value of attribute login_shell.
-
#path ⇒ Object
Returns the value of attribute path.
-
#repository ⇒ Object
Returns the value of attribute repository.
-
#skip_steps ⇒ Object
Returns the value of attribute skip_steps.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #configure ⇒ Object
- #configure_from(file) ⇒ Object
-
#initialize ⇒ Deploy
constructor
A new instance of Deploy.
- #local_setup ⇒ Object
- #local_update ⇒ Object
- #remote_setup ⇒ Object
- #remote_update ⇒ Object
- #server=(server) ⇒ Object
Methods included from DSL
#bundle_install, #clear_cache, #create_tmp, #install_gems, #load_module, #log, #login_shell_wrap, #migrate_database, #rake_db_create, #rake_gems_install, #rake_task, #remote_run, #run, #update_code
Methods included from Helper
#app_checkout, #application_path, #bundle_cmd, #camelize, #checkout, #configuration_file, #copy_example_file, #git_clone, #git_pull, #install_bundler, #skip_step?, #skip_steps_cmd, #using_bundler?
Constructor Details
#initialize ⇒ Deploy
Returns a new instance of Deploy.
8 9 10 11 |
# File 'lib/nodex/deploy.rb', line 8 def initialize self.server = :passenger configure end |
Instance Attribute Details
#application ⇒ Object
Returns the value of attribute application.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def application @application end |
#branch ⇒ Object
Returns the value of attribute branch.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def branch @branch end |
#cache_dirs ⇒ Object
Returns the value of attribute cache_dirs.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def cache_dirs @cache_dirs end |
#db_example_name ⇒ Object
Returns the value of attribute db_example_name.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def db_example_name @db_example_name end |
#environment ⇒ Object
Returns the value of attribute environment.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def environment @environment end |
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def host @host end |
#login_shell ⇒ Object
Returns the value of attribute login_shell.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def login_shell @login_shell end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def path @path end |
#repository ⇒ Object
Returns the value of attribute repository.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def repository @repository end |
#skip_steps ⇒ Object
Returns the value of attribute skip_steps.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def skip_steps @skip_steps end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/nodex/deploy.rb', line 6 def user @user end |
Instance Method Details
#configure ⇒ Object
17 18 19 |
# File 'lib/nodex/deploy.rb', line 17 def configure configure_from configuration_file if configuration_file end |
#configure_from(file) ⇒ Object
21 22 23 24 |
# File 'lib/nodex/deploy.rb', line 21 def configure_from(file) deploy = self eval file.read + ';local_variables.each { |variable| deploy.send "#{variable}=", eval(variable.to_s) rescue nil }' end |
#local_setup ⇒ Object
31 32 33 |
# File 'lib/nodex/deploy.rb', line 31 def local_setup after_update_code end |
#local_update ⇒ Object
39 40 41 42 |
# File 'lib/nodex/deploy.rb', line 39 def local_update update_code after_update_code end |
#remote_setup ⇒ Object
26 27 28 29 |
# File 'lib/nodex/deploy.rb', line 26 def remote_setup remote_run "cd #{path} && #{git_clone} && #{app_checkout} && #{copy_example_file} && #{install_bundler} && #{bundle_cmd} && #{rake_db_create}" local_setup end |
#remote_update ⇒ Object
35 36 37 |
# File 'lib/nodex/deploy.rb', line 35 def remote_update local_update end |
#server=(server) ⇒ Object
13 14 15 |
# File 'lib/nodex/deploy.rb', line 13 def server=(server) load_module "servers/#{server}" end |