capistrano-s3_archive 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/s3_archive/version.rb +1 -1
- data/lib/capistrano/s3_archive.rb +16 -0
- data/lib/capistrano/tasks/s3_archive.rake +6 -0
- 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: ff7aa63f69e0331804503575b7a0f22ae530e769
|
4
|
+
data.tar.gz: 378dc767657fbaf94fcc9d3614b63c5de742442a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d28fb64ce1f708b1282e7a8b50461bddc6a26249704cb1609b5f49db0d9120b26deaa8ac07ec369d1ab35e1df7d1d23bb910a67d67ddc0b1a2ae91bbd751c52
|
7
|
+
data.tar.gz: d59244e38ad90d614ce90f5f9bc3bc3c04bc6913e8076f886df1bc881bb0f0cfb9ea543e11fd52119904d72f3156c61edb864a4cf9f3ee54e33b6a849f00304d
|
@@ -110,6 +110,22 @@ module Capistrano
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
+
def cleanup
|
114
|
+
run_locally do
|
115
|
+
archives_dir = File.join(fetch(:s3_archive), fetch(:stage).to_s)
|
116
|
+
archives = capture(:ls, '-xtr', archives_dir).split
|
117
|
+
if archives.count >= fetch(:keep_releases)
|
118
|
+
tobe_removes = (archives - archives.last(fetch(:keep_releases)))
|
119
|
+
if tobe_removes.any?
|
120
|
+
tobe_removes_str = tobe_removes.map do |file|
|
121
|
+
File.join(archives_dir, file)
|
122
|
+
end.join(' ')
|
123
|
+
execute :rm, tobe_removes_str
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
113
129
|
def release(server = context.host)
|
114
130
|
user = server.user + '@' unless server.user.nil?
|
115
131
|
key = server.keys.first || Array(server.ssh_options[:keys]).first
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-s3_archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takuto Komazaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|