lib/evrone/ci/worker/middlewares/docker_script.rb in evrone-ci-worker-0.2.0.pre20 vs lib/evrone/ci/worker/middlewares/docker_script.rb in evrone-ci-worker-0.2.0.pre21
- old
+ new
@@ -36,22 +36,22 @@
script = [upload_sh_command(file, script_content(env, home))]
script << "env - HOME=$HOME bash #{file}"
script = script.join(" && ")
- env.ssh.spawn script, chdir: home, &env.job.method(:add_to_output)
+ env.ssh.spawn script, chdir: home, read_timeout: read_timeout, &env.job.method(:add_to_output)
end
def run_after_script(env)
home = config.docker.remote_dir
file = [home, ".ci_after_build.sh"].join("/")
script = [upload_sh_command(file, after_script_content(env))]
script << "env - HOME=$HOME bash #{file}"
script = script.join(" && ")
- env.ssh.spawn script, chdir: home, &env.job.method(:add_to_output)
+ env.ssh.spawn script, chdir: home, read_timeout: read_timeout, &env.job.method(:add_to_output)
end
def script_content(env, home)
buf = ["set -e"]
buf << "echo before_script > #{home}/.ci_state"
@@ -73,9 +73,13 @@
state_file = "#{home}/.ci_state"
env.ssh.spawn "cat #{state_file}" do |out|
buf << out
end
buf.strip
+ end
+
+ def read_timeout
+ 10 * 60
end
end
end
end