capistrano-scm-localgitcopy 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 880f05e66fda0b335b5ca54abf89849e928b3a07
4
- data.tar.gz: 5498d768ac01d408d321bdbab8b79ac0cd010e80
3
+ metadata.gz: a8df9d6b1c3fc32a52ec62f8891898dbc86e995b
4
+ data.tar.gz: be75ea6a389a0880805203ef966ebf1a04dbdd1a
5
5
  SHA512:
6
- metadata.gz: c23c3db9fd41f3c97e5ea7e1816d037715b4e75cc217bee68ddb884fe74450ec8df4cdbabe8c9a9400e3df4531333f7525eace07dd22de3997adba1785c87837
7
- data.tar.gz: 8f0374c1946adac164b48ef6b05ac56f9d649226855f0f1540797da590d00bf702d66a98abe8a526440107ca712f1d633255062c4045d829074e1ac51edf2a33
6
+ metadata.gz: cf4043912994f4a3fc82f29dc16a3d35757607acbd40bf04b107f01cee434df61a4a15e675f825d62940e6031c23211df5301bdf73a14cadb79954b889b79dec
7
+ data.tar.gz: 32732e492f97355830d01c8993bd6dd25cfeff569d020efed25058676f465cf072756a39b6854277c51bb34a23b31a6b236f97b26d13928bfe1774238c41c53e
data/README.md CHANGED
@@ -25,16 +25,16 @@ First make sure you install the capistrano-scm-localgitcopy by adding it to your
25
25
  Add to Capfile:
26
26
 
27
27
  require 'capistrano/scm/localgitcopy'
28
- install_plugin Capistrano::SCM::Localgitcopy
28
+ install_plugin Capistrano::SCM::LocalGitCopy
29
29
 
30
30
  ## Configuration (defaults)
31
31
  ```
32
- set :archive_name, 'deploy-archive.tar.gz' # local archive name
33
- set :include_dir, './' # you can use a subfolder for deployment
34
- set :tar_roles, :all # roles to run on tar
35
- set :tar_verbose, true # enable verbose mode for tar
36
- set :exclude_dir, nil # exclude directories
37
- set :temp_file, '/tmp/deploy-archive.tar.gz' # temp file on server
32
+ set :local_git_copy_archive_name, 'deploy-archive.tar.gz' # local archive name
33
+ set :local_git_copy_include_dir, './' # you can use a subfolder for deployment
34
+ set :local_git_copy_tar_roles, :all # roles to run on tar
35
+ set :local_git_copy_tar_verbose, true # enable verbose mode for tar
36
+ set :local_git_copy_exclude_dir, nil # exclude directories
37
+ set :local_git_copy_temp_file, '/tmp/deploy-archive.tar.gz' # temp file on server
38
38
  ```
39
39
 
40
40
  ## Pitfall: git and utf 8 chars
@@ -54,8 +54,10 @@ $ git commit -m "clean up bad encoding of file names"
54
54
  The MIT License (MIT)
55
55
 
56
56
  ### Changelog
57
+ ##### 0.2.0
58
+ - add prefix `local_git_copy_` to options
59
+ - rename plugin class from `Capistrano::SCM::Localgitcopy` to `Capistrano::SCM::LocalGitCopy`
60
+ - really use `local_git_copy_tar_roles`
57
61
 
58
- 0.1.0
59
- -----
60
-
62
+ ##### 0.1.0
61
63
  - Initial release
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "capistrano-scm-localgitcopy"
6
- s.version = "0.1.0"
6
+ s.version = "0.2.0"
7
7
  s.licenses = ["MIT"]
8
8
  s.authors = ["Tom Hanoldt"]
9
9
  s.email = ["tom@creative-workflow.berlin"]
@@ -1,13 +1,13 @@
1
1
  require "capistrano/scm/plugin"
2
2
 
3
- class Capistrano::SCM::Localgitcopy < ::Capistrano::SCM::Plugin
3
+ class Capistrano::SCM::LocalGitCopy < ::Capistrano::SCM::Plugin
4
4
  def set_defaults
5
- set_if_empty :archive_name, 'deploy-archive.tar.gz'
6
- set_if_empty :include_dir, './'
7
- set_if_empty :tar_roles, :all
8
- set_if_empty :tar_verbose, true
9
- set_if_empty :exclude_dir, nil
10
- set_if_empty :temp_file, '/tmp/deploy-archive.tar.gz'
5
+ set_if_empty :local_git_copy_archive_name, 'deploy-archive.tar.gz'
6
+ set_if_empty :local_git_copy_include_dir, './'
7
+ set_if_empty :local_git_copy_tar_roles, :all
8
+ set_if_empty :local_git_copy_tar_verbose, true
9
+ set_if_empty :local_git_copy_exclude_dir, nil
10
+ set_if_empty :local_git_copy_temp_file, '/tmp/deploy-archive.tar.gz'
11
11
  end
12
12
 
13
13
  def define_tasks
@@ -2,7 +2,9 @@ copy_plugin = self
2
2
 
3
3
  namespace :localgitcopy do
4
4
  task :create_release do
5
- on release_roles :all do
5
+ tar_roles = fetch(:local_git_copy_tar_roles, :all)
6
+
7
+ on release_roles tar_roles do
6
8
  set(:branch, copy_plugin.fetch_revision)
7
9
  execute :mkdir, "-p", release_path
8
10
 
@@ -10,8 +12,8 @@ namespace :localgitcopy do
10
12
  execute :mkdir, "-p", repo_path
11
13
 
12
14
  # Create a temporary file on the server
13
- tmp_file = fetch(:temp_file)
14
- archive_name = fetch(:archive_name)
15
+ tmp_file = fetch(:local_git_copy_temp_file)
16
+ archive_name = fetch(:local_git_copy_archive_name)
15
17
 
16
18
  execute :rm, "-f", tmp_file
17
19
  execute :touch, tmp_file
@@ -25,7 +27,9 @@ namespace :localgitcopy do
25
27
 
26
28
  desc "Determine the revision that will be deployed"
27
29
  task :set_current_revision do
28
- on release_roles :all do
30
+ tar_roles = fetch(:local_git_copy_tar_roles, :all)
31
+
32
+ on release_roles tar_roles do
29
33
  within repo_path do
30
34
  set :current_revision, copy_plugin.fetch_revision
31
35
  end
@@ -33,12 +37,13 @@ namespace :localgitcopy do
33
37
  end
34
38
 
35
39
  task :create_archive do
36
- on release_roles :all do
37
- archive_name = fetch(:archive_name)
38
- tar_verbose = fetch(:tar_verbose, true) ? "v" : ""
39
- tar_roles = fetch(:tar_roles, :all)
40
- include_dir = fetch(:include_dir)
41
- exclude_dir = Array(fetch(:exclude_dir))
40
+ tar_roles = fetch(:local_git_copy_tar_roles, :all)
41
+
42
+ on release_roles tar_roles do
43
+ archive_name = fetch(:local_git_copy_archive_name)
44
+ tar_verbose = fetch(:local_git_copy_tar_verbose, true) ? "v" : ""
45
+ include_dir = fetch(:local_git_copy_include_dir)
46
+ exclude_dir = Array(fetch(:local_git_copy_exclude_dir))
42
47
  exclude_args = exclude_dir.map { |dir| "--exclude '#{dir}'"}
43
48
 
44
49
  #cmd = "git archive #{tar_verbose} --format=tar.gz --output=#{archive_name} HEAD:#{include_dir}"
@@ -54,7 +59,7 @@ namespace :localgitcopy do
54
59
  end
55
60
 
56
61
  task :clean do
57
- archive_name = fetch(:archive_name)
62
+ archive_name = fetch(:local_git_copy_archive_name)
58
63
  File.delete archive_name if File.exists? archive_name
59
64
  end
60
65
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-scm-localgitcopy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Hanoldt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-18 00:00:00.000000000 Z
11
+ date: 2017-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano