capistrano-net_storage-s3 0.2.2 → 0.2.3

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: 2992a319fb7a4282147716b31fe7e8c379dd1d40
4
- data.tar.gz: c840ea5a48f423ec0939509255e1000091d93306
3
+ metadata.gz: 11baad0eae823de991032cd305a6597ddd036123
4
+ data.tar.gz: dde25b45ccb04d1e58c9f229932f2793eec14cdf
5
5
  SHA512:
6
- metadata.gz: 718985fd43ef6f9895f0da392b10282ae49d16874bb0c18e9dd481bd646a8c1d0677187690a87fb6b23610cf2691f978a0aacb6d581db13cd10c2bd5705e38ca
7
- data.tar.gz: 91c06e3aa98b211d5d56b09b744bbd1f7fc017932dfbe11718b83d161435c26dbf0797b7e35b0945a0c96bcef04dbb2fc95b3b0e2bd12935547af08b35428e28
6
+ metadata.gz: 3e50a343312b487b385b3509340052f872ea24e816701a1f655d714a1e1329756b87f58004398fc74234794d22aa827edb2f04dda2d1c6aa2633f22af90137d5
7
+ data.tar.gz: 90d9be1b33d181110b6382e1514fcab95a182092809d28126330d9182769b98d27e1f15de7e63449521a016d953c6fe397aa8e75bd2fa388e72a9a7a68874d8e
@@ -1,3 +1,10 @@
1
+ ## 0.2.3 (2017/5/10)
2
+
3
+ Enhancement:
4
+
5
+ - Add a config `:net_storage_s3_keep_release` as number to keep archives on S3
6
+ (#4)
7
+
1
8
  ## 0.2.2 (2017/5/9)
2
9
 
3
10
  Feature:
data/README.md CHANGED
@@ -40,6 +40,7 @@ Set Capistrano variables by `set name, value`.
40
40
  `:net_storage_s3_aws_config_file` | `ENV['AWS_CONFIG_FILE']` | AWS Config File
41
41
  `:net_storage_s3_bucket` | `nil` | S3 bucket name
42
42
  `:net_storage_s3_archives_directory` | `nil` | Directory for application archives in S3 bucket
43
+ `:net_storage_s3_keep_releases` | `:keep_releases` | Number to keep archives in S3
43
44
  `:net_storage_s3_max_retry` | `3` | Max retry times for S3 operations
44
45
 
45
46
  See also
@@ -54,7 +54,7 @@ class Capistrano::NetStorage::S3::Broker::AwsCLI < Capistrano::NetStorage::S3::B
54
54
 
55
55
  objects = JSON.parse(output)['Contents']
56
56
  sorted = objects.sort_by { |obj| Time.parse(obj['LastModified']) }
57
- fetch(:keep_releases).times do
57
+ c.s3_keep_releases.times do
58
58
  break if sorted.empty?
59
59
  sorted.pop
60
60
  end
@@ -122,5 +122,11 @@ class Capistrano::NetStorage::S3
122
122
  def max_retry
123
123
  @max_retry ||= fetch(:net_storage_s3_max_retry, 3)
124
124
  end
125
+
126
+ # Number to keep archives on S3
127
+ # @return [Fixnum]
128
+ def s3_keep_releases
129
+ @s3_keep_releases ||= fetch(:net_storage_s3_keep_releases, fetch(:keep_releases, 5))
130
+ end
125
131
  end
126
132
  end
@@ -1,5 +1,5 @@
1
1
  require 'capistrano/net_storage/s3/base'
2
2
 
3
3
  class Capistrano::NetStorage::S3
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-net_storage-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - progrhyme
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-09 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano-net_storage