Class: Dkdeploy::SCM::Copy
- Inherits:
-
Capistrano::SCM::Plugin
- Object
- Capistrano::SCM::Plugin
- Dkdeploy::SCM::Copy
- Defined in:
- lib/dkdeploy/scm/copy.rb
Overview
Class for the capistrano copy
Instance Method Summary collapse
-
#archive_filename ⇒ String
Archive filename as singleton Note: if the archive filename doesn’t already exist it will be generated.
- #define_tasks ⇒ Object
-
#local_archive_path ⇒ String
Archive path in a local temporary directory.
-
#local_exclude_path ⇒ String
Archive path in a local temporary directory.
-
#local_tmp_dir ⇒ String
Local temporary directory path as singleton Note: if the directory doesn’t already exist it will be created.
- #register_hooks ⇒ Object
-
#remote_archive_path ⇒ String
Archive path in a remote temporary directory.
-
#remote_tmp_dir ⇒ String
Remote temporary directory path.
- #set_defaults ⇒ Object
Instance Method Details
#archive_filename ⇒ String
Archive filename as singleton Note: if the archive filename doesn’t already exist it will be generated
44 45 46 |
# File 'lib/dkdeploy/scm/copy.rb', line 44 def archive_filename @archive_filename ||= Dir::Tmpname.make_tmpname [application + '_', '.tar.gz'], nil end |
#define_tasks ⇒ Object
36 37 38 |
# File 'lib/dkdeploy/scm/copy.rb', line 36 def define_tasks eval_rakefile File.('../copy.rake', __FILE__) end |
#local_archive_path ⇒ String
Archive path in a local temporary directory
66 67 68 |
# File 'lib/dkdeploy/scm/copy.rb', line 66 def local_archive_path File.join local_tmp_dir, archive_filename end |
#local_exclude_path ⇒ String
Archive path in a local temporary directory
59 60 61 |
# File 'lib/dkdeploy/scm/copy.rb', line 59 def local_exclude_path File.join local_tmp_dir, 'exclude.txt' end |
#local_tmp_dir ⇒ String
Local temporary directory path as singleton Note: if the directory doesn’t already exist it will be created
52 53 54 |
# File 'lib/dkdeploy/scm/copy.rb', line 52 def local_tmp_dir @local_tmp_dir ||= Dir.mktmpdir end |
#register_hooks ⇒ Object
30 31 32 33 34 |
# File 'lib/dkdeploy/scm/copy.rb', line 30 def register_hooks after 'deploy:new_release_path', 'copy:create_release' before 'deploy:check', 'copy:check' before 'deploy:set_current_revision', 'copy:set_current_revision' end |
#remote_archive_path ⇒ String
Archive path in a remote temporary directory
80 81 82 |
# File 'lib/dkdeploy/scm/copy.rb', line 80 def remote_archive_path File.join remote_tmp_dir, archive_filename end |
#remote_tmp_dir ⇒ String
Remote temporary directory path
73 74 75 |
# File 'lib/dkdeploy/scm/copy.rb', line 73 def remote_tmp_dir File.join fetch(:tmp_dir), application end |
#set_defaults ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dkdeploy/scm/copy.rb', line 13 def set_defaults set_if_empty :copy_source, 'htdocs' set_if_empty :copy_exclude, Array[ 'vendor/bundle/**', 'Gemfile*', '**/.git', '**/.svn', '**/.DS_Store', '.settings', '.project', '.buildpath', 'Capfile', 'Thumbs.db', 'composer.lock' ] end |