capistrano-net_storage-s3 0.2.2 → 0.3.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 +5 -5
- data/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- data/.travis.yml +6 -6
- data/CHANGELOG.md +7 -0
- data/README.md +12 -3
- data/lib/capistrano/net_storage/s3/broker/aws_cli.rb +3 -3
- data/lib/capistrano/net_storage/s3/config.rb +6 -0
- data/lib/capistrano/net_storage/s3/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 65abb23d537b71704d92ba0d0ef36cbe59089bafe8aecda6a81bb531af567fc6
|
|
4
|
+
data.tar.gz: b6374a14eb145e0e3e702cf416c2ff794a1333ce6dd88ffc6fe4ad24210f6fca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f39bbcbf009c681222d26ca87981a8117ee52dd46195054b80587ae0aa66335fccf37a2c67583cd60742dec5e2abf6b9361295efbb834c82b3bcc2775ecb65a6
|
|
7
|
+
data.tar.gz: 0f1c56c231fb8f176d380bd28216efe8030a6c6aeb881c9022f7d583469871f89c7a091109cab6c94fcbd951931df212bdfeb2535d7e3aa418c323250e798873
|
data/.travis.yml
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
sudo: false
|
|
2
2
|
language: ruby
|
|
3
3
|
rvm:
|
|
4
|
-
- 2.
|
|
5
|
-
- 2.
|
|
6
|
-
- 2.
|
|
7
|
-
before_install: gem install bundler
|
|
8
|
-
install: bundle
|
|
9
|
-
script: bundle
|
|
4
|
+
- 2.6.3
|
|
5
|
+
- 2.5.5
|
|
6
|
+
- 2.4.6
|
|
7
|
+
before_install: gem install bundler
|
|
8
|
+
install: bundle install
|
|
9
|
+
script: bundle exec rake spec
|
|
10
10
|
notifications:
|
|
11
11
|
slack:
|
|
12
12
|
secure: WFEsKPeewkV6n/LmpsvLbu17nT5AWxVr1yglUjhCEe8OGIukTOpTbdsnhv9ticj0vXNdKZZRQEe4B0BhC8Fn+iPbFLyi1Z4is7dmABVU+b1qSOKIQlCCoPqa8RzYuVPYzMcVs9E1ldVdrQfLXKYoVeFAFeFSzcrf4mmTDrJbHhOXFIp1GYfYnhCIf01R72pcc2sHfWrzL3croIAqVYFiYJlimjQgduqQGVnyQjCeFmERCnnJU4t4VUlDU1gxTi3VYLfUtyUFyo5Kp+msRMbjr7LVuXyv/JplnNX3skG7VYN2nyhL6VuuOMAfCDpDCeCpH5mJcB1xLagide+GgDVYPJMJG419Ao7vCNI+1cl4VojT8aZKOs6vR7AMBSCP6gittrDIWOCuD61fc5HLFBSzL5dD5u2b2AxAUuODohNKigKwY59tE5CePuMycS/wVaFBtZjAKwDJDKU95m8JCtqJGzHQ0mEMKrXKICal9O7GWwEuEV+EnU+yzk+ZqWM6AHpGJ48DSm3pMnlnoPy3SBs4W8tFH+IS18cKBJ795Nj2vdwZFEYUEo0UwZrch/STY0/rPHayts9/7vgzZOIur168kxIw5bDNisPqzMTeNiYECnNLYWBSa0Xqn8mKPu52GVJYW6L0Wa8LRxln6BcNv2DkS+JFjyUC04T5wAdD4ADnQd4=
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Set Capistrano variables by `set name, value`.
|
|
|
29
29
|
|
|
30
30
|
Name | Default | Description
|
|
31
31
|
------|---------|------------
|
|
32
|
-
`:scm` | `nil` | Set `:net_storage`
|
|
32
|
+
`:scm` | `nil` | Set `:net_storage` for capistrano before v3.7
|
|
33
33
|
`:net_storage_transport` | `nil` | Set `Capistrano::NetStorage::S3::Transport`
|
|
34
34
|
`:net_storage_s3_broker` | `:aws_cli` | Type of transportation broker
|
|
35
35
|
`:net_storage_s3_aws_access_key_id` | `ENV['AWS_ACCESS_KEY_ID']` | AWS Access Key ID
|
|
@@ -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
|
|
@@ -57,7 +58,13 @@ require 'capistrano/setup'
|
|
|
57
58
|
require 'capistrano/deploy'
|
|
58
59
|
|
|
59
60
|
# Includes tasks from other gems included in your Gemfile
|
|
60
|
-
|
|
61
|
+
if Gem::Version.new(Capistrano::VERSION) < Gem::Version.new('3.7.0')
|
|
62
|
+
require 'capistrano/net_storage'
|
|
63
|
+
else
|
|
64
|
+
require "capistrano/net_storage/plugin"
|
|
65
|
+
install_plugin Capistrano::NetStorage::Plugin
|
|
66
|
+
end
|
|
67
|
+
|
|
61
68
|
# Load transport plugin for Capistrano::NetStorage
|
|
62
69
|
require 'capistrano/net_storage/s3'
|
|
63
70
|
```
|
|
@@ -65,7 +72,9 @@ require 'capistrano/net_storage/s3'
|
|
|
65
72
|
Edit your `config/deploy.rb`:
|
|
66
73
|
|
|
67
74
|
```ruby
|
|
68
|
-
|
|
75
|
+
if Gem::Version.new(Capistrano::VERSION) < Gem::Version.new('3.7.0')
|
|
76
|
+
set :scm, :net_storage
|
|
77
|
+
end
|
|
69
78
|
set :net_storage_transport, Capistrano::NetStorage::S3::Transport
|
|
70
79
|
# set :net_storage_config_files, [your_config_files]
|
|
71
80
|
# set :net_storage_with_bundle, true
|
|
@@ -25,7 +25,7 @@ class Capistrano::NetStorage::S3::Broker::AwsCLI < Capistrano::NetStorage::S3::B
|
|
|
25
25
|
c = config
|
|
26
26
|
ns = net_storage
|
|
27
27
|
Retryable.retryable(tries: c.max_retry, sleep: 0.1) do
|
|
28
|
-
execute_aws_s3('cp', ns.local_archive_path, c.archive_url)
|
|
28
|
+
execute_aws_s3('cp', '--no-progress', ns.local_archive_path, c.archive_url)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
@@ -36,7 +36,7 @@ class Capistrano::NetStorage::S3::Broker::AwsCLI < Capistrano::NetStorage::S3::B
|
|
|
36
36
|
Retryable.retryable(tries: c.max_retry, sleep: 0.1) do
|
|
37
37
|
within releases_path do
|
|
38
38
|
with(c.aws_environments) do
|
|
39
|
-
execute :aws, 's3', 'cp', c.archive_url, ns.archive_path
|
|
39
|
+
execute :aws, 's3', 'cp', '--no-progress', c.archive_url, ns.archive_path
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
end
|
|
@@ -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
|
-
|
|
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
|
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.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- progrhyme
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-06-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capistrano-net_storage
|
|
@@ -82,11 +82,12 @@ dependencies:
|
|
|
82
82
|
version: '0'
|
|
83
83
|
description: A transport plugin of capistrano-net_storage to deploy application via
|
|
84
84
|
Amazon S3.
|
|
85
|
-
email:
|
|
85
|
+
email:
|
|
86
86
|
executables: []
|
|
87
87
|
extensions: []
|
|
88
88
|
extra_rdoc_files: []
|
|
89
89
|
files:
|
|
90
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
90
91
|
- ".gitignore"
|
|
91
92
|
- ".rspec"
|
|
92
93
|
- ".travis.yml"
|
|
@@ -109,7 +110,7 @@ homepage: https://github.com/DeNADev/capistrano-net_storage-s3
|
|
|
109
110
|
licenses:
|
|
110
111
|
- MIT
|
|
111
112
|
metadata: {}
|
|
112
|
-
post_install_message:
|
|
113
|
+
post_install_message:
|
|
113
114
|
rdoc_options: []
|
|
114
115
|
require_paths:
|
|
115
116
|
- lib
|
|
@@ -124,9 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
124
125
|
- !ruby/object:Gem::Version
|
|
125
126
|
version: '0'
|
|
126
127
|
requirements: []
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
signing_key:
|
|
128
|
+
rubygems_version: 3.4.13
|
|
129
|
+
signing_key:
|
|
130
130
|
specification_version: 4
|
|
131
131
|
summary: Plugin of capistrano-net_storage for Amazon S3
|
|
132
132
|
test_files: []
|