siba-destination-aws-s3 0.1.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.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Guardfile +9 -0
- data/LICENSE +20 -0
- data/README.md +36 -0
- data/Rakefile +28 -0
- data/lib/siba-destination-aws-s3.rb +11 -0
- data/lib/siba-destination-aws-s3/cloud.rb +139 -0
- data/lib/siba-destination-aws-s3/init.rb +48 -0
- data/lib/siba-destination-aws-s3/options.yml +3 -0
- data/lib/siba-destination-aws-s3/version.rb +9 -0
- data/siba-destination-aws-s3.gemspec +27 -0
- data/test/helper/require.rb +13 -0
- data/test/helper/require_integration.rb +5 -0
- data/test/helper/require_unit.rb +4 -0
- data/test/integration/i9n_cloud.rb +58 -0
- data/test/unit/test_cloud.rb +24 -0
- data/test/unit/test_init.rb +54 -0
- data/test/unit/yml/valid.yml +5 -0
- metadata +120 -0
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard 'minitest', :notify=>false do
|
5
|
+
watch(%r|^test/unit/(.*\/)*test_(.*)\.rb|)
|
6
|
+
watch(%r|^lib/siba-destination-aws-s3/(.*\/)*([^/]+)\.rb|) do |m|
|
7
|
+
"test/unit/#{m[1]}test_#{m[2]}.rb" unless m[2][0] == '.'
|
8
|
+
end
|
9
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Evgeny Neumerzhitskiy
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# Amazon S3 destination plugin for SIBA
|
2
|
+
|
3
|
+
This plugin lets you keep your SIBA backups in Amazon S3 cloud storage.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install siba-destination-aws-s3
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
Run `siba generate FILE` command to generate options file and select aws-s3 as destination plugin. After that edit the options file and set your Amazon S3 options.
|
12
|
+
|
13
|
+
## License
|
14
|
+
|
15
|
+
Copyright (c) 2011 Evgeny Neumerzhitskiy
|
16
|
+
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
18
|
+
a copy of this software and associated documentation files (the
|
19
|
+
"Software"), to deal in the Software without restriction, including
|
20
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
21
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
22
|
+
permit persons to whom the Software is furnished to do so, subject to
|
23
|
+
the following conditions:
|
24
|
+
|
25
|
+
The above copyright notice and this permission notice shall be
|
26
|
+
included in all copies or substantial portions of the Software.
|
27
|
+
|
28
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
29
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
30
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
31
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
32
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
33
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
34
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
35
|
+
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require 'rake/testtask'
|
3
|
+
|
4
|
+
namespace "test" do
|
5
|
+
desc "Run all unit tests"
|
6
|
+
Rake::TestTask.new("unit") do |t|
|
7
|
+
t.pattern = "test/unit/**/test*.rb"
|
8
|
+
t.libs << 'test'
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Run all integration tests"
|
12
|
+
Rake::TestTask.new("integration") do |t|
|
13
|
+
t.pattern = "test/integration/**/i9n_*.rb"
|
14
|
+
t.libs << 'test'
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run all integration tests"
|
18
|
+
task :i9n => ["test:integration"] do
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Run all unit tests"
|
23
|
+
task :test => ["test:unit"] do
|
24
|
+
end
|
25
|
+
|
26
|
+
desc "Run tests"
|
27
|
+
task :default => "test:unit"
|
28
|
+
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'aws/s3'
|
4
|
+
|
5
|
+
module Siba::Destination
|
6
|
+
module AwsS3
|
7
|
+
class Cloud
|
8
|
+
include Siba::FilePlug
|
9
|
+
include Siba::LoggerPlug
|
10
|
+
|
11
|
+
attr_accessor :bucket, :sub_dir, :access_key_id, :secret_key
|
12
|
+
|
13
|
+
def initialize(bucket, access_key_id, secret_key)
|
14
|
+
splitted_name = bucket.split("/")
|
15
|
+
@bucket = splitted_name.shift
|
16
|
+
@sub_dir = splitted_name.join("/")
|
17
|
+
@access_key_id = access_key_id
|
18
|
+
@secret_key = secret_key
|
19
|
+
|
20
|
+
check_connection
|
21
|
+
end
|
22
|
+
|
23
|
+
def upload(src_file)
|
24
|
+
file_name = File.basename src_file
|
25
|
+
logger.info "Uploading backup file to Amazon S3: #{file_name}, bucket: #{bucket_with_path}"
|
26
|
+
access_and_close do
|
27
|
+
unless siba_file.file_file? src_file
|
28
|
+
raise Siba::Error, "Can not find backup file for uploading: #{src_file}"
|
29
|
+
end
|
30
|
+
|
31
|
+
File.open(src_file, "rb") do |file|
|
32
|
+
AWS::S3::S3Object.store path(file_name), file
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def get_backups_list(backup_prefix)
|
38
|
+
backups = find_objects backup_prefix
|
39
|
+
siba_file.run_this do
|
40
|
+
backups.map do |obj|
|
41
|
+
[File.basename(obj.key), obj.last_modified]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def restore_backup_to_dir(backup_name, dir)
|
47
|
+
access_and_close do
|
48
|
+
path_to_file = File.join dir, backup_name
|
49
|
+
open(path_to_file, 'wb') do |file|
|
50
|
+
file.write(get_file backup_name)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def exists?(file_name)
|
56
|
+
access_and_close do
|
57
|
+
AWS::S3::S3Object.exists? path(file_name)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def bucket_exists?
|
62
|
+
access_and_close do
|
63
|
+
AWS::S3::Service.buckets.any?{|a| a.name == bucket}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def find_objects(object_prefix)
|
68
|
+
access_and_close do
|
69
|
+
AWS::S3::Bucket.objects(prefix: path(object_prefix))
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def get_file(file_name)
|
74
|
+
access_and_close do
|
75
|
+
begin
|
76
|
+
AWS::S3::S3Object.value path(file_name)
|
77
|
+
rescue
|
78
|
+
logger.error "Failed to get file #{file_name} from Amazon S3"
|
79
|
+
raise
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def delete(file_name)
|
85
|
+
access_and_close do
|
86
|
+
begin
|
87
|
+
AWS::S3::S3Object.delete path(file_name)
|
88
|
+
rescue
|
89
|
+
logger.error "Failed to delete file #{file_name} from Amazon S3"
|
90
|
+
raise
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def check_connection
|
96
|
+
siba_file.run_this do
|
97
|
+
raise Siba::Error, "Bucket '#{bucket}' does not exist." unless bucket_exists?
|
98
|
+
exists? "some_file"
|
99
|
+
logger.debug "Access to Amazon S3 is verified"
|
100
|
+
end
|
101
|
+
rescue Exception
|
102
|
+
logger.error "Can not connect to Amazon S3. Bucket: #{bucket_with_path}"
|
103
|
+
raise
|
104
|
+
end
|
105
|
+
|
106
|
+
private
|
107
|
+
|
108
|
+
def path(file)
|
109
|
+
return file if sub_dir.empty?
|
110
|
+
sub_dir + "/" + file
|
111
|
+
end
|
112
|
+
|
113
|
+
def bucket_with_path
|
114
|
+
return bucket if sub_dir.empty?
|
115
|
+
bucket + "/" + sub_dir
|
116
|
+
end
|
117
|
+
|
118
|
+
def access_and_close
|
119
|
+
siba_file.run_this do
|
120
|
+
begin
|
121
|
+
AWS::S3::Base.establish_connection!(
|
122
|
+
:access_key_id => access_key_id,
|
123
|
+
:secret_access_key => secret_key,
|
124
|
+
:use_ssl => true);
|
125
|
+
|
126
|
+
AWS::S3::Bucket.set_current_bucket_to bucket
|
127
|
+
AWS::S3::S3Object.set_current_bucket_to bucket
|
128
|
+
yield
|
129
|
+
ensure
|
130
|
+
begin
|
131
|
+
AWS::S3::Base.disconnect!
|
132
|
+
rescue
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'siba-destination-aws-s3/cloud'
|
4
|
+
|
5
|
+
module Siba::Destination
|
6
|
+
module AwsS3
|
7
|
+
class Init
|
8
|
+
include Siba::LoggerPlug
|
9
|
+
|
10
|
+
DEFAULT_ACCESS_KEY_ID_ENV_NAME = "SIBA_AMAZON_ACCESS_KEY_ID"
|
11
|
+
DEFAULT_SECRET_KEY_ENV_NAME = "SIBA_AMAZON_SECRET_ACCESS_KEY"
|
12
|
+
|
13
|
+
attr_accessor :cloud
|
14
|
+
|
15
|
+
def initialize(options)
|
16
|
+
bucket = Siba::SibaCheck.options_string options, "bucket"
|
17
|
+
|
18
|
+
access_key_id_name = "access_key_id"
|
19
|
+
secret_key_name = "secret_access_key"
|
20
|
+
access_key_id = Siba::SibaCheck.options_string options, access_key_id_name, true, ENV[DEFAULT_ACCESS_KEY_ID_ENV_NAME]
|
21
|
+
secret_key = Siba::SibaCheck.options_string options, secret_key_name, true, ENV[DEFAULT_SECRET_KEY_ENV_NAME]
|
22
|
+
|
23
|
+
raise Siba::CheckError, "Missing '#{access_key_id_name}' option" if access_key_id.nil?
|
24
|
+
raise Siba::CheckError, "Missing '#{secret_key_name}' option" if secret_key.nil?
|
25
|
+
|
26
|
+
logger.info "Checking connection to Amazon S3"
|
27
|
+
@cloud = Siba::Destination::AwsS3::Cloud.new bucket, access_key_id, secret_key
|
28
|
+
end
|
29
|
+
|
30
|
+
def backup(path_to_backup_file)
|
31
|
+
@cloud.upload path_to_backup_file
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns an array of two-element arrays:
|
35
|
+
# [backup_file_name, modification_time]
|
36
|
+
def get_backups_list(backup_name)
|
37
|
+
logger.info "Getting the list of backups from Amazon S3"
|
38
|
+
@cloud.get_backups_list backup_name
|
39
|
+
end
|
40
|
+
|
41
|
+
# Put backup file into dir
|
42
|
+
def restore(backup_name, dir)
|
43
|
+
logger.info "Downloading backup from Amazon S3"
|
44
|
+
@cloud.restore_backup_to_dir backup_name, dir
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "siba-destination-aws-s3/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "siba-destination-aws-s3"
|
7
|
+
s.version = Siba::Destination::AwsS3::VERSION
|
8
|
+
s.authors = ["Evgeny Neumerzhitskiy"]
|
9
|
+
s.email = ["sausageskin@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Writes SIBA backup to Amazon S3 storage}
|
12
|
+
s.description = %q{An extension for SIBA gem. Allows to upload backups to Amazon S3 cloud storage.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "siba-destination-aws-s3"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_runtime_dependency 'siba', '~>0.4'
|
22
|
+
s.add_runtime_dependency 'aws-s3', '~>0.6'
|
23
|
+
|
24
|
+
s.add_development_dependency 'minitest', '~>2.10'
|
25
|
+
s.add_development_dependency 'rake', '~>0.9'
|
26
|
+
s.add_development_dependency 'guard-minitest', '~>0.4'
|
27
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
gem 'minitest' # loads minitest from gem, not the included one
|
5
|
+
require 'minitest/autorun'
|
6
|
+
|
7
|
+
require 'siba'
|
8
|
+
require 'siba/helpers/test/file_mock'
|
9
|
+
require 'siba/helpers/test/kernel_mock'
|
10
|
+
require 'siba/helpers/test/extend_test'
|
11
|
+
require 'siba/helpers/test/removable_constants'
|
12
|
+
require 'siba/helpers/test/helper'
|
13
|
+
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'helper/require_integration'
|
4
|
+
require 'siba-destination-aws-s3/init'
|
5
|
+
|
6
|
+
describe Siba::Destination::AwsS3::Cloud do
|
7
|
+
before do
|
8
|
+
@cls = Siba::Destination::AwsS3::Cloud
|
9
|
+
@init = Siba::Destination::AwsS3::Init
|
10
|
+
|
11
|
+
bucket_env = "SIBA_TEST_AWS_S3_BUCKET_NAME"
|
12
|
+
access_key_id_env = @init::DEFAULT_ACCESS_KEY_ID_ENV_NAME
|
13
|
+
secret_key_env = @init::DEFAULT_SECRET_KEY_ENV_NAME
|
14
|
+
|
15
|
+
@bucket = ENV[bucket_env]
|
16
|
+
@access_key_id = ENV[access_key_id_env]
|
17
|
+
@secret_key = ENV[secret_key_env]
|
18
|
+
|
19
|
+
flunk "#{bucket_env} environment variable is not set" unless @bucket
|
20
|
+
flunk "#{access_key_id_env} environment variable is not set" unless @access_key_id
|
21
|
+
flunk "#{secret_key_env} environment variable is not set" unless @secret_key
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should upload file to cloud and get the list" do
|
25
|
+
begin
|
26
|
+
@cloud = @cls.new @bucket, @access_key_id, @secret_key
|
27
|
+
|
28
|
+
backup_name = "awss3-u"
|
29
|
+
path_to_test_file = prepare_test_file backup_name
|
30
|
+
@cloud.upload path_to_test_file
|
31
|
+
|
32
|
+
file_name = File.basename path_to_test_file
|
33
|
+
@cloud.exists?(file_name).must_equal true
|
34
|
+
@cloud.get_file(file_name).must_equal Siba::FileHelper.read(path_to_test_file)
|
35
|
+
|
36
|
+
# get list
|
37
|
+
list = @cloud.get_backups_list backup_name
|
38
|
+
full_backup_name = list[0][0]
|
39
|
+
full_backup_name.must_match /^#{backup_name}/
|
40
|
+
list[0][1].must_be_instance_of Time
|
41
|
+
|
42
|
+
# restore backup
|
43
|
+
dest_dir = mkdir_in_tmp_dir "awsbk"
|
44
|
+
@cloud.restore_backup_to_dir full_backup_name, dest_dir
|
45
|
+
path_to_dest_file = File.join dest_dir, full_backup_name
|
46
|
+
File.file?(path_to_dest_file).must_equal true
|
47
|
+
FileUtils.compare_file(path_to_test_file, path_to_dest_file).must_equal true
|
48
|
+
ensure
|
49
|
+
@cloud.delete(file_name)
|
50
|
+
@cloud.exists?(file_name).must_equal false
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should find objects" do
|
55
|
+
@cloud = @cls.new @bucket, @access_key_id, @secret_key
|
56
|
+
@cloud.find_objects("my").must_be_instance_of Array
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'helper/require_unit'
|
4
|
+
require 'siba-destination-aws-s3/init'
|
5
|
+
|
6
|
+
describe Siba::Destination::AwsS3::Cloud do
|
7
|
+
before do
|
8
|
+
@obj = Siba::Destination::AwsS3::Cloud.new "bucket", "two", "umi"
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should assign variables" do
|
12
|
+
@obj.bucket.must_equal "bucket"
|
13
|
+
@obj.access_key_id.must_equal "two"
|
14
|
+
@obj.secret_key.must_equal "umi"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should upload" do
|
18
|
+
@obj.upload "/file"
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should upload" do
|
22
|
+
@obj.get_backups_list "backups"
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'helper/require_unit'
|
4
|
+
require 'siba-destination-aws-s3/init'
|
5
|
+
|
6
|
+
describe Siba::Destination::AwsS3::Init do
|
7
|
+
before do
|
8
|
+
@obj = Siba::Destination::AwsS3::Init
|
9
|
+
@yml_path = File.expand_path('../yml', __FILE__)
|
10
|
+
@options_hash = load_options "valid"
|
11
|
+
@plugin = @obj.new @options_hash
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should load plugin" do
|
15
|
+
@plugin.must_be_instance_of Siba::Destination::AwsS3::Init
|
16
|
+
@plugin.cloud.must_be_instance_of Siba::Destination::AwsS3::Cloud
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should not fail if keys are missing but env variables are defined" do
|
20
|
+
ENV[@obj::DEFAULT_ACCESS_KEY_ID_ENV_NAME] = "akd"
|
21
|
+
ENV[@obj::DEFAULT_SECRET_KEY_ENV_NAME] = "sk"
|
22
|
+
cloud = @obj.new({"bucket"=>"bucket"})
|
23
|
+
cloud.cloud.access_key_id.must_equal "akd"
|
24
|
+
cloud.cloud.secret_key.must_equal "sk"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should fail if keys are missing" do
|
28
|
+
ENV[@obj::DEFAULT_ACCESS_KEY_ID_ENV_NAME] = nil
|
29
|
+
ENV[@obj::DEFAULT_SECRET_KEY_ENV_NAME] = "sk"
|
30
|
+
->{@obj.new({"bucket"=>"bucket"})}.must_raise Siba::CheckError
|
31
|
+
|
32
|
+
ENV[@obj::DEFAULT_ACCESS_KEY_ID_ENV_NAME] = "akd"
|
33
|
+
ENV[@obj::DEFAULT_SECRET_KEY_ENV_NAME] = nil
|
34
|
+
->{@obj.new({"bucket"=>"bucket"})}.must_raise Siba::CheckError
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should fail when bucket is missing" do
|
38
|
+
->{@obj.new({})}.must_raise Siba::CheckError
|
39
|
+
->{@obj.new({"secret_key"=>"value"})}.must_raise Siba::CheckError
|
40
|
+
->{@obj.new({"access_key_id"=>"value"})}.must_raise Siba::CheckError
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should run backup" do
|
44
|
+
@plugin.backup "/file"
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should run get_backups_list" do
|
48
|
+
@plugin.get_backups_list "/file"
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should run restore" do
|
52
|
+
@plugin.restore "backup_name", "/dir"
|
53
|
+
end
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: siba-destination-aws-s3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Evgeny Neumerzhitskiy
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: siba
|
16
|
+
requirement: &85710210 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.4'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *85710210
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: aws-s3
|
27
|
+
requirement: &85709390 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.6'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *85709390
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: minitest
|
38
|
+
requirement: &85705900 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.10'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *85705900
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: &85705530 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.9'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *85705530
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: guard-minitest
|
60
|
+
requirement: &85705130 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0.4'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *85705130
|
69
|
+
description: An extension for SIBA gem. Allows to upload backups to Amazon S3 cloud
|
70
|
+
storage.
|
71
|
+
email:
|
72
|
+
- sausageskin@gmail.com
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- Guardfile
|
80
|
+
- LICENSE
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- lib/siba-destination-aws-s3.rb
|
84
|
+
- lib/siba-destination-aws-s3/cloud.rb
|
85
|
+
- lib/siba-destination-aws-s3/init.rb
|
86
|
+
- lib/siba-destination-aws-s3/options.yml
|
87
|
+
- lib/siba-destination-aws-s3/version.rb
|
88
|
+
- siba-destination-aws-s3.gemspec
|
89
|
+
- test/helper/require.rb
|
90
|
+
- test/helper/require_integration.rb
|
91
|
+
- test/helper/require_unit.rb
|
92
|
+
- test/integration/i9n_cloud.rb
|
93
|
+
- test/unit/test_cloud.rb
|
94
|
+
- test/unit/test_init.rb
|
95
|
+
- test/unit/yml/valid.yml
|
96
|
+
homepage: ''
|
97
|
+
licenses: []
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
110
|
+
requirements:
|
111
|
+
- - ! '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project: siba-destination-aws-s3
|
116
|
+
rubygems_version: 1.8.11
|
117
|
+
signing_key:
|
118
|
+
specification_version: 3
|
119
|
+
summary: Writes SIBA backup to Amazon S3 storage
|
120
|
+
test_files: []
|