Class: Egads::Stage
- Includes:
- Thor::Actions
- Defined in:
- lib/egads/command/stage.rb
Instance Method Summary collapse
- #bundle ⇒ Object
- #extract ⇒ Object
- #mark_as_staged ⇒ Object
- #run_after_stage_hooks ⇒ Object
- #run_before_hooks ⇒ Object
- #setup_environment ⇒ Object
- #symlink_config_files ⇒ Object
- #symlink_system_paths ⇒ Object
Methods inherited from Group
Instance Method Details
#bundle ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/egads/command/stage.rb', line 23 def bundle return unless should_stage? inside(dir) do run_with_code("bundle install #{RemoteConfig.}", stream: true) if File.readable?("Gemfile") end end |
#extract ⇒ Object
14 15 16 |
# File 'lib/egads/command/stage.rb', line 14 def extract invoke(Egads::Extract, [sha], ) end |
#mark_as_staged ⇒ Object
55 56 57 |
# File 'lib/egads/command/stage.rb', line 55 def mark_as_staged FileUtils.touch(stage_flag_path) end |
#run_after_stage_hooks ⇒ Object
50 51 52 53 |
# File 'lib/egads/command/stage.rb', line 50 def run_after_stage_hooks return unless should_stage? inside(dir) { run_hooks_for(:stage, :after) } end |
#run_before_hooks ⇒ Object
18 19 20 21 |
# File 'lib/egads/command/stage.rb', line 18 def run_before_hooks return unless should_stage? inside(dir){ run_hooks_for(:stage, :before) } end |
#setup_environment ⇒ Object
10 11 12 |
# File 'lib/egads/command/stage.rb', line 10 def setup_environment RemoteConfig.setup_environment end |
#symlink_config_files ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/egads/command/stage.rb', line 37 def symlink_config_files return unless should_stage? && shared_path shared_config = File.join(shared_path, 'config') if File.directory?(shared_config) Dir.glob("#{shared_config}/*").each do |source| basename = File.basename(source) destination = File.join(dir, 'config', basename) symlink(source, destination) end end end |
#symlink_system_paths ⇒ Object
31 32 33 34 35 |
# File 'lib/egads/command/stage.rb', line 31 def symlink_system_paths return unless should_stage? && shared_path symlink_directory File.join(shared_path, 'system'), File.join(dir, 'public', 'system') symlink_directory File.join(shared_path, 'log'), File.join(dir, 'log') end |