capistrano-stretcher 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8e5f3a71942a87223377de95f967dafc0c6d98a
4
- data.tar.gz: beaf3211fa458ac234f6c29ce9e7d7279d23f7ae
3
+ metadata.gz: a341c8909b6f497f940161ab074a422166cd802e
4
+ data.tar.gz: a728bf6953c6841dcbae5702ff3ac844d93ed9ac
5
5
  SHA512:
6
- metadata.gz: 395fe44311ad2536a4feaeaf34f3ed6d717dba1b051c2bf38cd7db7bc4aac35bc636fc006f6d6e99fc351e177180c12e7d98bb5171975a9bfb4b6131a966b363
7
- data.tar.gz: 8020d46593226d2f79b09b8a888b9f53b7b178379c8c747e70b4b96bf340033c07609c114defa4b641bac94736d26ae9e70cbef2c4a1626223ff5ff011a789a8
6
+ metadata.gz: d99cc7e5754730f2f27b82df2a7000bcff8b146c31696f23e355988a93219cfc934fdbdedd07ce6fe6cc986d35557e5bcb6e308350fa28824b1ae65995765030
7
+ data.tar.gz: 3aa3a09700f9ee7e043cc26a2dfc6bac6a10aad1900f6aab871ad769b12eec2cfb343b9376489ca0c43ee785c1dd8cb638564c1e04f2d87e74b9c9089f015fd2
data/README.md CHANGED
@@ -52,6 +52,8 @@ set :stretcher_hooks, 'config/stretcher.yml.erb'
52
52
  set :local_tarball_name, 'rails-applicaiton.tar.gz'
53
53
  set :stretcher_src, "s3://your-deployment-bucket/assets/rails-application-#{env.now}.tgz"
54
54
  set :manifest_path, "s3://your-deployment-bucket/manifests/"
55
+ # Optional, if you want to use mv
56
+ set :stretcher_sync_strategy, "mv"
55
57
  ```
56
58
 
57
59
  and write hooks for stretcher to `config/stretcher.yml.erb`
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "capistrano-stretcher"
7
- spec.version = "0.2.0"
7
+ spec.version = "0.3.0"
8
8
  spec.authors = ["SHIBATA Hiroshi", "Uchio Kondo"]
9
9
  spec.email = ["hsbt@ruby-lang.org", "udzura@udzura.jp"]
10
10
 
@@ -2,8 +2,14 @@
2
2
  require 'erb'
3
3
  require 'yaml'
4
4
 
5
+ namespace :load do
6
+ task :defaults do
7
+ set :gzip_compress_level, "-9"
8
+ end
9
+ end
10
+
5
11
  namespace :stretcher do
6
- set :exclude_dirs, ['tmp']
12
+ set :exclude_dirs, ["tmp"]
7
13
 
8
14
  def local_working_path_base
9
15
  @_local_working_path_base ||= fetch(:local_working_path_base, "/var/tmp/#{fetch :application}")
@@ -67,7 +73,7 @@ namespace :stretcher do
67
73
  execute :echo, fetch(:current_revision), "> #{local_checkout_path}/#{env.now}/REVISION"
68
74
 
69
75
  execute :rsync, "-av", "--delete",
70
- *fetch(:exclude_dirs).map{|d| ['--exclude', d].join(' ')},
76
+ *fetch(:exclude_dirs, ["tmp"]).map{|d| ['--exclude', d].join(' ')},
71
77
  "#{local_checkout_path}/#{env.now}/", "#{local_build_path}/",
72
78
  "| pv -l -s $( find #{local_checkout_path}/#{env.now}/ -type f | wc -l ) >/dev/null"
73
79
  end
@@ -77,11 +83,12 @@ namespace :stretcher do
77
83
  task :create_tarball do
78
84
  on application_builder_roles do
79
85
  within local_build_path do
86
+ compress_level = fetch(:gzip_compress_level, "-9")
80
87
  execute :mkdir, '-p', "#{local_tarball_path}/#{env.now}"
81
88
  execute :tar, '-cf', '-',
82
89
  "--exclude tmp", "--exclude spec", "./",
83
90
  "| pv -s $( du -sb ./ | awk '{print $1}' )",
84
- "| gzip -9 > #{local_tarball_path}/#{env.now}/#{fetch(:local_tarball_name)}"
91
+ "| gzip #{compress_level} > #{local_tarball_path}/#{env.now}/#{fetch(:local_tarball_name)}"
85
92
  end
86
93
  within local_tarball_path do
87
94
  execute :rm, '-f', 'current'
@@ -26,3 +26,6 @@ commands:
26
26
  excludes:
27
27
  - "*.pid"
28
28
  - "*.socket"
29
+ <% if strategy = fetch(:stretcher_sync_strategy, false) %>
30
+ sync_strategy: <%= strategy %>
31
+ <% end %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-stretcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIBATA Hiroshi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-03-30 00:00:00.000000000 Z
12
+ date: 2016-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.2.3
110
+ rubygems_version: 2.4.5.1
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: capistrano task for stretcher.