class CORL::Builder::Identity

Public Instance Methods

build_directory() click to toggle source
   # File lib/CORL/builder/identity.rb
18 def build_directory
19   File.join(network.directory, 'config', 'identities')
20 end
build_provider(name, project_reference, environment, options = {}) click to toggle source
   # File lib/CORL/builder/identity.rb
35 def build_provider(name, project_reference, environment, options = {})
36   provider_id = id(name)
37   directory   = File.join(internal_path(build_directory), provider_id.to_s)
38   config      = Config.ensure(options)
39   success     = true
40 
41   info("Building identity #{blue(name)} at #{purple(project_reference)} into #{green(directory)}", { :i18n => false })
42 
43   full_directory = File.join(network.directory, directory)
44   FileUtils.rm_rf(full_directory) if config.get(:clean, false)
45 
46   unless identities.has_key?(provider_id)
47     project = build_config.manage(:project, extended_config(:identity, {
48       :directory      => full_directory,
49       :url            => project_reference,
50       :create         => File.directory?(full_directory) ? false : true,
51       :pull           => true,
52       :internal_ip    => CORL.public_ip, # Needed for seeding Vagrant VMs
53       :manage_ignore  => false,
54       :nucleon_resave => true
55     }))
56     unless project
57       warn("Identity #{cyan(name)} failed to initialize", { :i18n => false })
58       success = false
59     end
60 
61     if success
62       # Make thid project private.
63       FileUtils.chmod_R('go-wrx', full_directory)
64 
65       set_identity(provider_id, full_directory)
66       build_config.set_location(plugin_provider, name, directory)
67     end
68   end
69   #success("Build of identity #{blue(name)} finished", { :i18n => false }) if success
70   success
71 end
identities() click to toggle source
   # File lib/CORL/builder/identity.rb
24 def identities
25   @identities
26 end
normalize(reload) click to toggle source
Calls superclass method
   # File lib/CORL/builder/identity.rb
 9 def normalize(reload)
10   super do
11     @identities = {}
12   end
13 end
set_identity(name, directory) click to toggle source
   # File lib/CORL/builder/identity.rb
28 def set_identity(name, directory)
29   @identities[name] = directory
30 end