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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eafd8fc55f08df16dbd7526cf0dda903b9ba9e94
4
- data.tar.gz: b4bb921c26e7e5448e8be48e6627878411094f52
3
+ metadata.gz: c5d0c501ac595b3bce5344c3dc65f02d05713fa2
4
+ data.tar.gz: 9f435ab11895d2e513cfafd60b05e18277e135b6
5
5
  SHA512:
6
- metadata.gz: ef0bf6e4deb54cf2084adea99e9c1522e43419bfe2fe83c82e15a2f28f91a5204db050c56c2b1f95cf58b906e99a9356422c8cf66d9627566cac30983cd1a06e
7
- data.tar.gz: f780ca9e6dc7cab19f582edadc6c50cd863127aa6d3bfe7ebba6f7c7f365e460aa3f92a070465c5783692d0db8112fd567e039ec8ae4e7f4216230ff7971ec0c
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 = '0.1.0'
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| FileUtils.rm_rf "#{temp_folder}/#{env.release_timestamp}/#{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
 
@@ -13,7 +13,6 @@ namespace :copy_strategy do
13
13
  task create_release: :'copy_strategy:update' do
14
14
  on release_roles :all do
15
15
  within repo_path do
16
- warn "test, on: 3"
17
16
  copy_strategy_plugin.archive_to_release_path
18
17
  end
19
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-scm-copy_strategy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Brino