Module: Luban::Deployment::Service::Configurator::Base
- Defined in:
- lib/luban/deployment/cli/service/configurator.rb
Instance Method Summary collapse
- #default_templates ⇒ Object
- #exclude_template?(template) ⇒ Boolean
- #init_profile ⇒ Object
- #profile_templates(format: "erb") ⇒ Object
- #profile_templates_path ⇒ Object
- #stage_profile_path ⇒ Object
- #stage_profile_templates_path ⇒ Object
- #update_profile ⇒ Object
Instance Method Details
#default_templates ⇒ Object
34 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 34 def default_templates; task.opts.default_templates; end |
#exclude_template?(template) ⇒ Boolean
32 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 32 def exclude_template?(template); false; end |
#init_profile ⇒ Object
36 37 38 39 40 41 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 36 def init_profile return if default_templates.empty? puts " Initializing #{service_name} profile" assure_dirs(profile_templates_path, stage_profile_path) upload_profile_templates end |
#profile_templates(format: "erb") ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 21 def profile_templates(format: "erb") return @profile_templates unless @profile_templates.nil? @profile_templates = [] [profile_templates_path, stage_profile_templates_path].each do |path| Dir.chdir(path) { @profile_templates |= Dir["**/*.#{format}"] } if path.directory? end @profile_templates.tap do |templates| templates.reject! { |t| exclude_template?(t) } end end |
#profile_templates_path ⇒ Object
11 12 13 14 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 11 def profile_templates_path @profile_templates_path ||= config_finder[:application].profile_templates_path.join(service_name) end |
#stage_profile_path ⇒ Object
6 7 8 9 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 6 def stage_profile_path @stage_profile_path ||= config_finder[:application].stage_profile_path.join(service_name) end |
#stage_profile_templates_path ⇒ Object
16 17 18 19 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 16 def stage_profile_templates_path @stage_profile_templates_path ||= config_finder[:application].stage_profile_templates_path.join(service_name) end |
#update_profile ⇒ Object
43 44 45 46 47 |
# File 'lib/luban/deployment/cli/service/configurator.rb', line 43 def update_profile assure_dirs(stage_profile_path) render_profile update_logrotate_files end |