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 +4 -4
- data/README.md +12 -10
- data/capistrano-scm-localgitcopy.gemspec +1 -1
- data/lib/capistrano/scm/localgitcopy.rb +7 -7
- data/lib/capistrano/scm/tasks/localgitcopy.rake +16 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8df9d6b1c3fc32a52ec62f8891898dbc86e995b
|
4
|
+
data.tar.gz: be75ea6a389a0880805203ef966ebf1a04dbdd1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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::
|
28
|
+
install_plugin Capistrano::SCM::LocalGitCopy
|
29
29
|
|
30
30
|
## Configuration (defaults)
|
31
31
|
```
|
32
|
-
set :
|
33
|
-
set :
|
34
|
-
set :
|
35
|
-
set :
|
36
|
-
set :
|
37
|
-
set :
|
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
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require "capistrano/scm/plugin"
|
2
2
|
|
3
|
-
class Capistrano::SCM::
|
3
|
+
class Capistrano::SCM::LocalGitCopy < ::Capistrano::SCM::Plugin
|
4
4
|
def set_defaults
|
5
|
-
set_if_empty :
|
6
|
-
set_if_empty :
|
7
|
-
set_if_empty :
|
8
|
-
set_if_empty :
|
9
|
-
set_if_empty :
|
10
|
-
set_if_empty :
|
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
|
-
|
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(:
|
14
|
-
archive_name = fetch(:
|
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
|
-
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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(:
|
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.
|
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-
|
11
|
+
date: 2017-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|