Module: Deployinator
- Defined in:
- lib/deployinator.rb,
lib/deployinator/app.rb,
lib/deployinator/plugin.rb,
lib/deployinator/helpers.rb,
lib/deployinator/logging.rb,
lib/deployinator/version.rb,
lib/deployinator/controller.rb,
lib/deployinator/helpers/dsh.rb,
lib/deployinator/helpers/git.rb,
lib/deployinator/helpers/view.rb,
lib/deployinator/views/layout.rb,
lib/deployinator/helpers/deploy.rb,
lib/deployinator/helpers/plugin.rb,
lib/deployinator/helpers/version.rb,
lib/deployinator/helpers/stack-tail.rb,
lib/deployinator/helpers/concurrency.rb
Overview
This is the main entry point for all things in the Deployination.
Defined Under Namespace
Modules: Helpers, Views Classes: Controller, Deploy, DeployinatorApp, Plugin
Constant Summary collapse
- VERSION =
"1.1.0"
- @@stats_renamed_stacks =
[]
Class Attribute Summary collapse
-
.admin_groups ⇒ Object
Returns the value of attribute admin_groups.
-
.app_context ⇒ Object
a hash for context specifics settings (test,dev,production) of deployinator itself.
-
.default_user ⇒ Object
Default username for passwordless ssh.
-
.deploy_controller ⇒ Object
the controller class.
-
.deploy_host ⇒ Object
Deploy Host.
-
.domain ⇒ Object
Your company domain name.
-
.git_info_for_stack ⇒ Object
Git info per stack.
-
.git_sha_length ⇒ Object
Returns the value of attribute git_sha_length.
-
.github_host ⇒ Object
Default github_host.
-
.global_plugins ⇒ Object
Returns the value of attribute global_plugins.
-
.hostname ⇒ Object
Hostname where deployinator runs.
-
.issue_tracker ⇒ Object
Bug or issue tracker - proc that takes the issue id as an argument ex: Deployinator.issue_tracker = proc {|issue| “foo/browse/#{issue}”}.
-
.log_file ⇒ Object
File to log to.
-
.log_path ⇒ Object
Log path.
-
.maintenance_contact ⇒ Object
Returns the value of attribute maintenance_contact.
-
.maintenance_mode ⇒ Object
Returns the value of attribute maintenance_mode.
-
.root_dir ⇒ Object
Your install root.
-
.stack_plugins ⇒ Object
Returns the value of attribute stack_plugins.
-
.stack_tailer_port ⇒ Object
Returns the value of attribute stack_tailer_port.
-
.stats_extra_grep ⇒ Object
filter log entries in /stats.
-
.stats_ignored_stacks ⇒ Object
exclude stacks in /stats, even if present in stats_included_stacks.
-
.stats_included_stacks ⇒ Object
include stacks in /stats.
-
.stats_renamed_stacks ⇒ Object
list of configurations for grouping historical / renamed stacks in /stats.
-
.timing_log_path ⇒ Object
Timing Log path.
Class Method Summary collapse
-
.env ⇒ Object
Running environment for deployinator This is taken from RACK_ENV or RAILS_ENV note this is different from deployinator’s concept of stacks/environments.
-
.get_stack_files ⇒ Object
Gets all the stack files in the stack directory.
-
.get_stacks ⇒ Object
Gets all the stack names without the .rb extension.
- .initialize ⇒ Object
-
.log_file? ⇒ Boolean
is a log file defined?.
-
.root(path = nil) ⇒ Object
Base root path Takes an optional argument of a string or array and returns the path(s) From the root of deployinator.
- .setup_logging ⇒ Object
Class Attribute Details
.admin_groups ⇒ Object
Returns the value of attribute admin_groups.
54 55 56 |
# File 'lib/deployinator.rb', line 54 def admin_groups @admin_groups end |
.app_context ⇒ Object
a hash for context specifics settings (test,dev,production) of deployinator itself
29 30 31 |
# File 'lib/deployinator.rb', line 29 def app_context @app_context end |
.default_user ⇒ Object
Default username for passwordless ssh
19 20 21 |
# File 'lib/deployinator.rb', line 19 def default_user @default_user end |
.deploy_controller ⇒ Object
the controller class. defaults to Deployinator::Controller if you override this it should be a subclass of Deployinator::Controller
63 64 65 |
# File 'lib/deployinator.rb', line 63 def deploy_controller @deploy_controller end |
.deploy_host ⇒ Object
Deploy Host
38 39 40 |
# File 'lib/deployinator.rb', line 38 def deploy_host @deploy_host end |
.domain ⇒ Object
Your company domain name
13 14 15 |
# File 'lib/deployinator.rb', line 13 def domain @domain end |
.git_info_for_stack ⇒ Object
Git info per stack
35 36 37 |
# File 'lib/deployinator.rb', line 35 def git_info_for_stack @git_info_for_stack end |
.git_sha_length ⇒ Object
Returns the value of attribute git_sha_length.
46 47 48 |
# File 'lib/deployinator.rb', line 46 def git_sha_length @git_sha_length end |
.github_host ⇒ Object
Default github_host
22 23 24 |
# File 'lib/deployinator.rb', line 22 def github_host @github_host end |
.global_plugins ⇒ Object
Returns the value of attribute global_plugins.
48 49 50 |
# File 'lib/deployinator.rb', line 48 def global_plugins @global_plugins end |
.hostname ⇒ Object
Hostname where deployinator runs
16 17 18 |
# File 'lib/deployinator.rb', line 16 def hostname @hostname end |
.issue_tracker ⇒ Object
Bug or issue tracker - proc that takes the issue id as an argument ex: Deployinator.issue_tracker = proc {|issue| “foo/browse/#{issue}”}
26 27 28 |
# File 'lib/deployinator.rb', line 26 def issue_tracker @issue_tracker end |
.log_file ⇒ Object
File to log to
10 11 12 |
# File 'lib/deployinator.rb', line 10 def log_file @log_file end |
.log_path ⇒ Object
Log path
44 45 46 |
# File 'lib/deployinator.rb', line 44 def log_path @log_path end |
.maintenance_contact ⇒ Object
Returns the value of attribute maintenance_contact.
59 60 61 |
# File 'lib/deployinator.rb', line 59 def maintenance_contact @maintenance_contact end |
.maintenance_mode ⇒ Object
Returns the value of attribute maintenance_mode.
57 58 59 |
# File 'lib/deployinator.rb', line 57 def maintenance_mode @maintenance_mode end |
.root_dir ⇒ Object
Your install root
32 33 34 |
# File 'lib/deployinator.rb', line 32 def root_dir @root_dir end |
.stack_plugins ⇒ Object
Returns the value of attribute stack_plugins.
50 51 52 |
# File 'lib/deployinator.rb', line 50 def stack_plugins @stack_plugins end |
.stack_tailer_port ⇒ Object
Returns the value of attribute stack_tailer_port.
52 53 54 |
# File 'lib/deployinator.rb', line 52 def stack_tailer_port @stack_tailer_port end |
.stats_extra_grep ⇒ Object
filter log entries in /stats
72 73 74 |
# File 'lib/deployinator.rb', line 72 def stats_extra_grep @stats_extra_grep end |
.stats_ignored_stacks ⇒ Object
exclude stacks in /stats, even if present in stats_included_stacks
69 70 71 |
# File 'lib/deployinator.rb', line 69 def stats_ignored_stacks @stats_ignored_stacks end |
.stats_included_stacks ⇒ Object
include stacks in /stats
66 67 68 |
# File 'lib/deployinator.rb', line 66 def stats_included_stacks @stats_included_stacks end |
.stats_renamed_stacks ⇒ Object
list of configurations for grouping historical / renamed stacks in /stats
75 76 77 |
# File 'lib/deployinator.rb', line 75 def stats_renamed_stacks @stats_renamed_stacks end |
.timing_log_path ⇒ Object
Timing Log path
41 42 43 |
# File 'lib/deployinator.rb', line 41 def timing_log_path @timing_log_path end |
Class Method Details
.env ⇒ Object
Running environment for deployinator This is taken from RACK_ENV or RAILS_ENV note this is different from deployinator’s concept of stacks/environments
100 101 102 |
# File 'lib/deployinator.rb', line 100 def env ENV["RACK_ENV"] || ENV["RAILS_ENV"] || "development" end |
.get_stack_files ⇒ Object
Gets all the stack files in the stack directory
105 106 107 |
# File 'lib/deployinator.rb', line 105 def get_stack_files Dir[Deployinator.root(["stacks", "*.rb"])] end |
.get_stacks ⇒ Object
Gets all the stack names without the .rb extension
110 111 112 113 114 |
# File 'lib/deployinator.rb', line 110 def get_stacks self.get_stack_files.sort.map do |file| File.basename(file, ".rb") end end |
.initialize ⇒ Object
78 79 80 81 82 |
# File 'lib/deployinator.rb', line 78 def initialize @stack_plugins = {} @global_plugins = [] @admin_groups = [] end |
.log_file? ⇒ Boolean
is a log file defined?
93 94 95 |
# File 'lib/deployinator.rb', line 93 def log_file? log_file end |
.root(path = nil) ⇒ Object
Base root path Takes an optional argument of a string or array and returns the path(s) From the root of deployinator
87 88 89 90 |
# File 'lib/deployinator.rb', line 87 def root(path = nil) base = Deployinator.root_dir path ? File.join(base, path) : base end |
.setup_logging ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/deployinator/logging.rb', line 2 def self.setup_logging if Deployinator.log_file? $deployinator_log_handle = File.new(Deployinator.log_file, "a") def $stdout.write(string) $deployinator_log_handle.write string super end $stdout.sync = true $stderr.reopen($deployinator_log_handle) puts "Logging #{Deployinator.log_file}" end end |