capistrano-scm-copy_strategy 0.1.0 → 1.0.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 +27 -4
- data/capistrano-scm-copy_strategy.gemspec +1 -1
- data/lib/capistrano/scm/copy-strategy.rb +5 -4
- data/lib/capistrano/scm/tasks/copy-strategy.rake +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5d0c501ac595b3bce5344c3dc65f02d05713fa2
|
4
|
+
data.tar.gz: 9f435ab11895d2e513cfafd60b05e18277e135b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 234d6a7d5fab344831fdd400bb225b574ef7e57052785e8e32b5c44b5ab4d8e2ecf059fe58aafa05f10d5a66fa90c534e38d4989525c4a85016cfe1357e01c2c
|
7
|
+
data.tar.gz: 56b9e56829acd5762e396f389aee6ee711a36d8c4bfc9c573c972ba8eda8bcad8693d82d3f68d5d762eea3cb857135c84e42622ea24d27adeb586d7b89868c99
|
data/README.md
CHANGED
@@ -6,8 +6,7 @@ A copy strategy for Capistrano 3, which mimics the `:copy` scm of Capistrano 2.
|
|
6
6
|
This will make Capistrano tar the current directory, upload it to the server(s) and then extract it in the release directory.
|
7
7
|
|
8
8
|
|
9
|
-
Installation
|
10
|
-
============
|
9
|
+
## Installation
|
11
10
|
|
12
11
|
First make sure you install the capistrano-scm-copy_strategy by adding it to your `Gemfile`:
|
13
12
|
|
@@ -17,9 +16,33 @@ Add to Capfile:
|
|
17
16
|
|
18
17
|
require 'capistrano/scm/copy_strategy'
|
19
18
|
install_plugin Capistrano::SCM::CopyStrategy
|
19
|
+
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
By default the deploy strategy make a tar of all the current directory. Then pushes the tarball onto the server in the repo folder and expand it on the release directory.
|
24
|
+
|
25
|
+
If you like to customize the flow, here a list of available settings:
|
26
|
+
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
# Folder to compress
|
30
|
+
set :include_dir, "."
|
31
|
+
|
32
|
+
# Local temp folder where to temporary copy files
|
33
|
+
set :temp_folder, "#{Dir.tmpdir}", false
|
34
|
+
|
35
|
+
# Folder to exclude from the tarball. (Relative to the include dirs. You can use wildcards!)
|
36
|
+
set :exclude_dirs, []
|
37
|
+
|
38
|
+
# Name of the archive. By default is the release timestamp.
|
39
|
+
set :archive_name, "#{env.release_timestamp}.tar.gz"
|
40
|
+
|
41
|
+
```
|
42
|
+
|
43
|
+
|
20
44
|
|
21
|
-
TODO
|
22
|
-
====
|
45
|
+
## TODO
|
23
46
|
|
24
47
|
I'm new to programming for Capistrano and even Ruby in general. So any feedback is appreciated.
|
25
48
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'capistrano-scm-copy_strategy'
|
3
|
-
s.version = '
|
3
|
+
s.version = '1.0.0'
|
4
4
|
s.date = '2017-04-10'
|
5
5
|
s.summary = "A copy strategy for Capistrano 3, which mimics the :copy scm of Capistrano 2."
|
6
6
|
s.description = "This will make Capistrano tar the current directory, upload it to the server(s) and then extract it in the release directory."
|
@@ -42,15 +42,16 @@ module Capistrano
|
|
42
42
|
exclude_dirs.push(archive_name)
|
43
43
|
temp_folder = fetch(:temp_folder)
|
44
44
|
|
45
|
-
warn temp_folder
|
46
|
-
|
47
45
|
FileUtils.copy_entry include_dir, "#{temp_folder}/#{env.release_timestamp}"
|
48
46
|
|
49
47
|
# sh "ls -al #{temp_folder}/#{env.release_timestamp}"
|
50
48
|
|
51
|
-
exclude_dirs.map { |dir|
|
49
|
+
exclude_dirs.map { |dir|
|
50
|
+
FileUtils.rm_rf "#{temp_folder}/#{env.release_timestamp}/#{dir}"
|
51
|
+
FileUtils.rm_rf Dir.glob("#{temp_folder}/#{env.release_timestamp}/#{dir}")
|
52
|
+
}
|
52
53
|
|
53
|
-
sh "ls -al #{temp_folder}/#{env.release_timestamp}"
|
54
|
+
sh "ls -al #{temp_folder}/#{env.release_timestamp}/web"
|
54
55
|
|
55
56
|
tar_verbose = fetch(:tar_verbose, true) ? "v" : ""
|
56
57
|
|