class Egads::Stage
Public Instance Methods
bundle()
click to toggle source
# File lib/egads/command/stage.rb, line 23 def bundle return unless should_stage? inside(dir) do run_with_code("bundle install #{RemoteConfig.bundler_options}", stream: true) if File.readable?("Gemfile") end end
extract()
click to toggle source
# File lib/egads/command/stage.rb, line 14 def extract invoke(Egads::Extract, [sha], options) end
mark_as_staged()
click to toggle source
# File lib/egads/command/stage.rb, line 55 def mark_as_staged FileUtils.touch(stage_flag_path) end
run_after_stage_hooks()
click to toggle source
# 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()
click to toggle source
# 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()
click to toggle source
# File lib/egads/command/stage.rb, line 10 def setup_environment RemoteConfig.setup_environment end
symlink_config_files()
click to toggle source
# 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()
click to toggle source
# 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
Protected Instance Methods
dir()
click to toggle source
# File lib/egads/command/stage.rb, line 60 def dir RemoteConfig.release_dir(sha) end
should_stage?()
click to toggle source
# File lib/egads/command/stage.rb, line 68 def should_stage? options[:force] || !File.exists?(stage_flag_path) end
stage_flag_path()
click to toggle source
# File lib/egads/command/stage.rb, line 64 def stage_flag_path File.join(dir, '.egads-stage-success') end