Class: Xnlogic::CLI::Deploy
- Inherits:
-
Object
- Object
- Xnlogic::CLI::Deploy
- Defined in:
- lib/xnlogic/cli/deploy.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#thor ⇒ Object
readonly
Returns the value of attribute thor.
Instance Method Summary collapse
-
#initialize(options, thor) ⇒ Deploy
constructor
A new instance of Deploy.
- #options_file ⇒ Object
- #server_profile(hostname) ⇒ Object
Constructor Details
#initialize(options, thor) ⇒ Deploy
7 8 9 10 11 |
# File 'lib/xnlogic/cli/deploy.rb', line 7 def initialize(, thor) @options = {}.merge @thor = thor @app = Pathname.pwd end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
5 6 7 |
# File 'lib/xnlogic/cli/deploy.rb', line 5 def app @app end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/xnlogic/cli/deploy.rb', line 5 def @options end |
#thor ⇒ Object (readonly)
Returns the value of attribute thor.
5 6 7 |
# File 'lib/xnlogic/cli/deploy.rb', line 5 def thor @thor end |
Instance Method Details
#options_file ⇒ Object
13 14 15 |
# File 'lib/xnlogic/cli/deploy.rb', line 13 def app + 'config/deploy_options.yaml' end |
#server_profile(hostname) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/xnlogic/cli/deploy.rb', line 17 def server_profile(hostname) opts = { hostname: hostname, api_hostname: .fetch('api_hostname', hostname), ssh_user: ['ssh_user'], ssh_key: ['ssh_key'] } base_templates = { "server_profiles/profile.rb.tt" => "server_profiles/#{hostname.gsub('.', '_')}.rb", } Xnlogic.ui.info "" Xnlogic.ui.info "Creating server profile for #{ hostname }" Xnlogic.ui.info "" base_templates.each do |src, dst| thor.template("deploy/#{src}", app.join(dst), opts) end end |