Class: R10K::Environment::SVN
- Includes:
- Logging, Util::Setopts
- Defined in:
- lib/r10k/environment/svn.rb
Overview
This class implements an environment based on an SVN branch.
Constant Summary
Constants included from Logging
Instance Attribute Summary collapse
- #password ⇒ Object readonly
- #remote ⇒ Object readonly
- #username ⇒ Object readonly
- #working_dir ⇒ Object readonly
Attributes inherited from Base
#basedir, #dirname, #name, #path, #puppetfile
Instance Method Summary collapse
-
#initialize(name, basedir, dirname, options = {}) ⇒ SVN
constructor
Initialize the given SVN environment.
- #status ⇒ Object
-
#sync ⇒ void
Perform an initial checkout of the SVN repository or update the repository.
- #sync_modules ⇒ Object deprecated private Deprecated.
Methods included from Logging
formatter, included, level, level=, levels, #logger, #logger_name, outputter, parse_level
Methods inherited from Base
Constructor Details
#initialize(name, basedir, dirname, options = {}) ⇒ SVN
Initialize the given SVN environment.
43 44 45 46 47 48 49 |
# File 'lib/r10k/environment/svn.rb', line 43 def initialize(name, basedir, dirname, = {}) super setopts(, {:remote => :self, :username => :self, :password => :self}) @working_dir = R10K::SVN::WorkingDir.new(Pathname.new(@full_path), :username => @username, :password => @password) end |
Instance Attribute Details
#password ⇒ Object (readonly)
29 30 31 |
# File 'lib/r10k/environment/svn.rb', line 29 def password @password end |
#remote ⇒ Object (readonly)
14 15 16 |
# File 'lib/r10k/environment/svn.rb', line 14 def remote @remote end |
#username ⇒ Object (readonly)
24 25 26 |
# File 'lib/r10k/environment/svn.rb', line 24 def username @username end |
#working_dir ⇒ Object (readonly)
19 20 21 |
# File 'lib/r10k/environment/svn.rb', line 19 def working_dir @working_dir end |
Instance Method Details
#status ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/r10k/environment/svn.rb', line 67 def status if !@path.exist? :absent elsif !@working_dir.is_svn? :mismatched elsif !(@remote == @working_dir.url) :mismatched elsif !@synced :outdated else :insync end end |
#sync ⇒ void
This method returns an undefined value.
Perform an initial checkout of the SVN repository or update the repository.
If the environment is being created for the first time, it will automatically update all modules to ensure that the environment is complete.
58 59 60 61 62 63 64 65 |
# File 'lib/r10k/environment/svn.rb', line 58 def sync if @working_dir.is_svn? @working_dir.update else @working_dir.checkout(@remote) end @synced = true end |
#sync_modules ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Deprecated.
83 84 85 86 87 88 |
# File 'lib/r10k/environment/svn.rb', line 83 def sync_modules modules.each do |mod| logger.debug "Deploying module #{mod.name}" mod.sync end end |