Class: Capistrano::SCM::Static
- Inherits:
-
Plugin
- Object
- Plugin
- Capistrano::SCM::Static
- Defined in:
- lib/capistrano/scm/static.rb,
lib/capistrano/scm/static/version.rb
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
- #define_tasks ⇒ Object
- #load_contents_from_dir ⇒ Object
- #register_hooks ⇒ Object
- #set_defaults ⇒ Object
Instance Method Details
#define_tasks ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/capistrano/scm/static.rb', line 10 def define_tasks this_plugin = self namespace :static do task :create_release do files = this_plugin.load_contents_from_dir on release_roles :all do execute :mkdir, "-p", release_path files.each do |file| upload! "#{fetch(:dist)}/#{file}", release_path, recursive: true end end end end end |
#load_contents_from_dir ⇒ Object
29 30 31 |
# File 'lib/capistrano/scm/static.rb', line 29 def load_contents_from_dir Dir.entries(fetch(:dist)).select {|f| !File.directory? f} end |
#register_hooks ⇒ Object
25 26 27 |
# File 'lib/capistrano/scm/static.rb', line 25 def register_hooks after "deploy:new_release_path", "static:create_release" end |
#set_defaults ⇒ Object
7 8 |
# File 'lib/capistrano/scm/static.rb', line 7 def set_defaults end |