lib/capistrano/container.rb in capistrano-container-0.0.4 vs lib/capistrano/container.rb in capistrano-container-0.0.5

- old
+ new

@@ -67,19 +67,33 @@ puts capture("docker #{command}") end else on roles(:container_host) do - puts capture("docker #{command}") + puts capture("docker #{command}") end end end def ask_for_container_id() invoke 'container:all' ask(:container_id, "container id?") fetch(:container_id) + end + + def local_stage? + fetch(:local_stage_name).to_sym == fetch(:stage).to_sym + end + + def execute_local_or_remote(cmd) + if local_stage? + run_locally do + execute cmd + end + else + execute cmd + end end end end