Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/s3endpoint #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/astrails/safe/config/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def collection(*names)
end

simple_value :verbose, :dry_run, :local_only, :path, :command,
:options, :user, :host, :port, :password, :key, :secret, :bucket,
:options, :user, :host, :port, :password, :key, :secret, :bucket, :endpoint,
:api_key, :container, :socket, :service_net, :repo_path
multi_value :skip_tables, :exclude, :files
hash_value :mysqldump, :tar, :gpg, :keep, :pgdump, :tar, :svndump,
Expand Down
6 changes: 5 additions & 1 deletion lib/astrails/safe/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def save
raise RuntimeError, "pipe-streaming not supported for S3." unless @backup.path

# needed in cleanup even on dry run
AWS::S3::Base.establish_connection!(:access_key_id => key, :secret_access_key => secret, :use_ssl => true) unless local_only?
AWS::S3::Base.establish_connection!(:access_key_id => key, :secret_access_key => secret, :s3_endpoint => endpoint, :use_ssl => true) unless local_only?

puts "Uploading #{bucket}:#{full_path}" if verbose? || dry_run?
unless dry_run? || local_only?
Expand Down Expand Up @@ -64,6 +64,10 @@ def key
config[:s3, :key]
end

def endpoint
config[:s3, :endpoint]
end

def secret
config[:s3, :secret]
end
Expand Down