Skip to content

Commit

Permalink
Merge commit 'tango/master' into refactoring
Browse files Browse the repository at this point in the history
Conflicts:
	lib/astrails/safe.rb
	safe.gemspec
  • Loading branch information
vitaly committed May 20, 2009
2 parents 064cc40 + c423203 commit 410116b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.markdown
Expand Up @@ -136,6 +136,12 @@ Example configuration

end

svndump do
repo :my_repo do
repo_path "/home/svn/my_repo"
end
end

tar do
archive "git-repositories", :files => "/home/git/repositories"
archive "dot-configs", :files => "/home/*/.[^.]*"
Expand Down
14 changes: 14 additions & 0 deletions examples/unit/config_example.rb
Expand Up @@ -47,6 +47,11 @@

end

svndump do
repo :my_repo do
repo_path "/home/svn/my_repo"
end
end

tar do
archive "git-repositories" do
Expand Down Expand Up @@ -105,6 +110,15 @@
},
},
},

"svndump" => {
"repos" => {
"my_repo"=> {
"repo_path" => "/home/svn/my_repo"
}
}
},

"tar" => {
"archives" => {
"git-repositories" => {"files" => "/home/git/repositories"},
Expand Down
9 changes: 8 additions & 1 deletion lib/astrails/safe.rb
Expand Up @@ -18,6 +18,7 @@
require 'astrails/safe/source'
require 'astrails/safe/mysqldump'
require 'astrails/safe/archive'
require 'astrails/safe/svndump'

require 'astrails/safe/pipe'
require 'astrails/safe/gpg'
Expand Down Expand Up @@ -48,8 +49,14 @@ def safe(&block)
end
end

if repos = config[:svndump, :repos]
repos.each do |name, config|
Astrails::Safe::Svndump.new(name, config).backup.run(config, :gpg, :gzip, :local, :s3)
end
end

Astrails::Safe::TmpFile.cleanup
end
module_function :safe
end
end
end
4 changes: 2 additions & 2 deletions lib/astrails/safe/config/builder.rb
Expand Up @@ -2,9 +2,9 @@ module Astrails
module Safe
module Config
class Builder
COLLECTIONS = %w/database archive/
COLLECTIONS = %w/database archive repo/
ITEMS = %w/s3 key secret bucket path gpg password keep local mysqldump options
user host port socket skip_tables tar files exclude filename/
user host port socket skip_tables tar files exclude filename svndump repo_path/
NAMES = COLLECTIONS + ITEMS
def initialize(node)
@node = node
Expand Down
13 changes: 13 additions & 0 deletions lib/astrails/safe/svndump.rb
@@ -0,0 +1,13 @@
module Astrails
module Safe
class Svndump < Source

def command
@command ||= "svnadmin dump #{@config[:repo_path]}"
end

def extension; '.svn'; end

end
end
end

0 comments on commit 410116b

Please sign in to comment.