lib/evrone/ci/worker/middlewares/docker_script.rb in evrone-ci-worker-0.2.0.pre10 vs lib/evrone/ci/worker/middlewares/docker_script.rb in evrone-ci-worker-0.2.0.pre11
- old
+ new
@@ -2,10 +2,12 @@
module CI
module Worker
DockerScript = Struct.new(:app) do
+ TIMEOUT = 30 * 60
+
include Helper::Logger
include Helper::Config
include Common::Helper::UploadShCommand
def call(env)
@@ -36,21 +38,21 @@
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, timeout: 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, timeout: TIMEOUT, &env.job.method(:add_to_output)
end
def script_content(env, home)
buf = ["set -e"]
buf << "echo before_script > #{home}/.ci_state"