Module: Wukong::Deploy
- Includes:
- Plugin
- Defined in:
- lib/wukong-deploy.rb,
lib/wukong-deploy/repo.rb,
lib/wukong-deploy/console.rb,
lib/wukong-deploy/version.rb,
lib/wukong-deploy/templater.rb,
lib/wukong-deploy/deploy_pack.rb,
lib/wukong-deploy/rake_runner.rb,
lib/wukong-deploy/deploy_runner.rb,
lib/wukong-deploy/templater/differ.rb,
lib/wukong-deploy/templater/messaging.rb,
lib/wukong-deploy/extensions/s3_syncer.rb,
lib/wukong-deploy/extensions/ftp_syncer.rb,
lib/wukong-deploy/extensions/uses_lockfile.rb,
lib/wukong-deploy/extensions/prepare_syncer.rb,
lib/wukong-deploy/extensions/uses_file_state.rb,
lib/wukong-deploy/templater/conflict_resolution.rb,
lib/wukong-deploy/extensions/storm_invocation_override.rb,
lib/wukong-deploy/extensions/hadoop_invocation_override.rb
Overview
Provides some helper methods for loading the assets within a deploy pack at runtime and for Wukong plugins to ask questions about the deploy pack they're running in.
Defined Under Namespace
Modules: ConflictResolution, FTPSyncerOverride, HadoopInvocationOverride, Messaging, PrepareSyncerOverride, S3SyncerOverride, StormInvocationOverride, UsesFileStateOverride, UsesLockfileOverride Classes: Console, DeployRunner, Differ, RakeRunner, Repo, Templater
Constant Summary collapse
- VERSION =
'0.2.0'
Class Method Summary collapse
-
.app_dir ⇒ Pathname
The directory this deploy pack puts all its application code in.
-
.boot(settings, path) ⇒ Object
Boot the deploy pack, reading all available +settings+ and rooting it at the given +path+.
-
.booted? ⇒ true, false
Has this deploy pack been completely booted, all settings read, &c.
-
.config_dir ⇒ Pathname
The directory this deploy pack uses for configuration files.
-
.configure(settings, program) ⇒ Object
Configure the given settings object for use with Wukong::Deploy.
-
.data_dir ⇒ Pathname
The directory this deploy pack keeps local, sample data in.
-
.environment ⇒ String
Return the current environment the deploy pack is in.
-
.lib_dir ⇒ Pathname
The directory this deploy pack uses for lib files.
-
.log_dir ⇒ Pathname
The directory this deploy pack uses for logs.
-
.name ⇒ Object
Return the name of this deploy pack.
-
.pre_deploy_settings ⇒ Configliere::Param
Return the settings the deploy pack had before it booted itself -- these are used to pass to other tools when invoking them, since they will read the deploy pack settings themselves anyway.
-
.require_recursive(glob, ext = '.rb') ⇒ Object
Recursively require each Ruby file +dir+.
-
.root ⇒ Pathname
The root directory of this deploy pack.
-
.script_dir ⇒ Pathname
The directory this deploy pack puts all its scripts in.
-
.settings ⇒ Configliere::Param
Return the deploy pack's own settings.
-
.spec_dir ⇒ Pathname
The directory this deploy pack puts all its Ruby unit tests.
-
.src_dir ⇒ Pathname
The directory this deploy pack puts all its non-Ruby source code.
-
.tmp_dir ⇒ Pathname
The directory this deploy pack uses for temporary files.
Class Method Details
.app_dir ⇒ Pathname
The directory this deploy pack puts all its application code in.
69 70 71 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 69 def self.app_dir root.join('app') end |
.boot(settings, path) ⇒ Object
Boot the deploy pack, reading all available +settings+ and rooting it at the given +path+.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/wukong-deploy.rb', line 46 def self.boot settings, path # # Require just enough of wukong-hadoop to give us changes at the # # processor level. The rest is only required when running the # # 'wu-hadoop' program. Also grab configuration since we'll need it. # require 'wukong-hadoop/extensions' # # Grab configuration from Wonderdog. # require 'wonderdog' @pre_deploy_settings = settings.dup @settings = settings @root = Pathname.new(path) read_common_settings read_environment_settings read_deploy_settings read_remote_settings @booted = true end |
.booted? ⇒ true, false
Has this deploy pack been completely booted, all settings read, &c.
45 46 47 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 45 def self.booted? @booted end |
.config_dir ⇒ Pathname
The directory this deploy pack uses for configuration files.
76 77 78 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 76 def self.config_dir root.join('config') end |
.configure(settings, program) ⇒ Object
Configure the given settings object for use with Wukong::Deploy
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/wukong-deploy.rb', line 20 def self.configure settings, program settings.define(:environment, :description => "The environment to run in", :default => 'development', :flag => 'e', :env_var => 'ICS_PLATFORM_ENV') case program when 'wu-deploy' settings.define(:dry_run, :description => "Don't actually create or modify anything", :type => :boolean, :default => false) settings.define(:skip, :description => "Skip existing files", :type => :boolean, :default => false) settings.define(:force, :description => "Overwrite existing files", :type => :boolean, :default => false) when 'wu-hadoop' require_relative('wukong-deploy/hadoop_extensions') settings[:command_prefix] = 'bundle exec' when 'wu-storm' require_relative('wukong-deploy/storm_extensions') settings[:command_prefix] = 'bundle exec' when 'wu-dump' require_relative('wukong-deploy/dump_extensions') when 'wu-sync', 'wu-sync-all' require_relative('wukong-deploy/sync_extensions') end end |
.data_dir ⇒ Pathname
The directory this deploy pack keeps local, sample data in.
83 84 85 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 83 def self.data_dir root.join('data') end |
.environment ⇒ String
Return the current environment the deploy pack is in.
30 31 32 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 30 def self.environment settings[:environment] end |
.lib_dir ⇒ Pathname
The directory this deploy pack uses for lib files.
90 91 92 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 90 def self.lib_dir root.join('lib') end |
.log_dir ⇒ Pathname
The directory this deploy pack uses for logs.
97 98 99 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 97 def self.log_dir root.join('log') end |
.name ⇒ Object
Return the name of this deploy pack.
5 6 7 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 5 def self.name settings[:application] end |
.pre_deploy_settings ⇒ Configliere::Param
Return the settings the deploy pack had before it booted itself -- these are used to pass to other tools when invoking them, since they will read the deploy pack settings themselves anyway.
55 56 57 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 55 def self.pre_deploy_settings @pre_deploy_settings end |
.require_recursive(glob, ext = '.rb') ⇒ Object
Recursively require each Ruby file +dir+.
23 24 25 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 23 def self.require_recursive glob, ext='.rb' Dir[root.join("#{glob}/**/*#{ext}")].each { |path| require(path) } end |
.root ⇒ Pathname
The root directory of this deploy pack.
12 13 14 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 12 def self.root @root end |
.script_dir ⇒ Pathname
The directory this deploy pack puts all its scripts in.
104 105 106 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 104 def self.script_dir root.join('script') end |
.settings ⇒ Configliere::Param
Return the deploy pack's own settings.
37 38 39 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 37 def self.settings @settings end |
.spec_dir ⇒ Pathname
The directory this deploy pack puts all its Ruby unit tests.
111 112 113 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 111 def self.spec_dir root.join('spec') end |
.src_dir ⇒ Pathname
The directory this deploy pack puts all its non-Ruby source code.
119 120 121 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 119 def self.src_dir root.join('src') end |
.tmp_dir ⇒ Pathname
The directory this deploy pack uses for temporary files.
126 127 128 |
# File 'lib/wukong-deploy/deploy_pack.rb', line 126 def self.tmp_dir root.join('tmp') end |