Module: Pupcap::Capistrano
- Included in:
- CLI
- Defined in:
- lib/pupcap/capistrano.rb
Instance Method Summary collapse
- #cap_create_instance ⇒ Object
- #cap_execute_tasks(file, tasks) ⇒ Object
- #cap_use_rsync!(cap) ⇒ Object
Instance Method Details
#cap_create_instance ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/pupcap/capistrano.rb', line 26 def cap_create_instance cap = Capistrano::Configuration.new cap.logger.level = Capistrano::Logger::DEBUG cap.set :application, application cap.set :pupcap_root, pupcap_root cap.set :provision_key, provision_key cap.set :provision_key_pub, provision_key_pub cap.set :deploy_to, "/tmp/pupcap" cap.set :use_sudo, false cap.set :pupcap_options, cap.[:keys] = cap.provision_key cap.[:forward_agent] = true cap.[:pty] = true cap.set :scm, :git cap.set :copy_exclude, [".git", ".keys"] cap end |
#cap_execute_tasks(file, tasks) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/pupcap/capistrano.rb', line 6 def cap_execute_tasks(file, tasks) cap = cap_create_instance cap = yield(cap) if block_given? ["deploy", pupcap_capfile, file].each{|f| cap.load f } tasks.each do |task| cap.find_and_execute_task(task) cap_use_rsync!(cap) end cap end |
#cap_use_rsync!(cap) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/pupcap/capistrano.rb', line 17 def cap_use_rsync!(cap) if cap.fetch(:pupcap_use_rsync, false) cap.set :repository, "." cap.set :scm, :none cap.set :deploy_via, :copy end cap end |