cirun 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86ebf0d46cace9e15ec46cd6b670d483c7e40430193f531385ba681bb4305b69
4
- data.tar.gz: e7880da339144b2b2a9162efe91320291e1d97d32420b71b51c3e9f9c654017f
3
+ metadata.gz: e20d4dbe347265c9858ccb17382908c84aa50f5ed9ccf4302e81e032b9aeb42c
4
+ data.tar.gz: 6fb7ec33e53ad2a7c7160a3bed903b335d5497c3116a4a6691c86252dbb26bbf
5
5
  SHA512:
6
- metadata.gz: d23e2bf94a777c721990557ac22201ae1a6fa5ec0d5ae6140b526b4a158364f2c92e2057c0732b469e8eaa463edb7f5df590f82cf2309b34d37b772d40e0b5e4
7
- data.tar.gz: 8bf26ce829ff4c21668d8cc7d40403846039c24a7f7bbb245f144e537a0f3d74d14d3b6bac156a8a84aeed71bac249ae601039aa292bca28c34fab3a0836c79a
6
+ metadata.gz: e20361fbb05ed1ad64188918874001e6b7f9c20f29693eab7304ba0ade2616fcb865732c206ca248ced87932706b301c7e4bbdc2d982981411bd793255bbc590
7
+ data.tar.gz: 4dc02c96567e79ddd4050bbbb83dbf5e44d849920ebc69d929b2bc2e00b8fc3f1a7bc1b6fa78926613de28573fa59bc7cf6e0c7471c0df1e41a72b90d354a94a
data/lib/cirun/runner.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'open3'
2
+
1
3
  module Cirun
2
4
  class Runner
3
5
  def initialize(opts)
@@ -7,15 +9,25 @@ module Cirun
7
9
  def update_image
8
10
  puts "Pulling redmineup/#{@opts.plugin}, please wait"
9
11
  cmd = "docker pull redmineup/#{@opts.plugin}"
10
- puts `#{cmd}`
12
+ execute(cmd)
11
13
  end
12
14
 
13
15
  def run
14
16
  update_image
15
17
  ruby_short = @opts.ruby.split('-').first
16
18
  cmd = "docker run -t --env RUBY_VERSION=ruby-#{ruby_short} --env DB=#{@opts.database} --env REDMINE=redmine-#{@opts.redmine} --env PLUGIN=#{@opts.plugin} --env DEPENDENT=#{@opts.dependent} --mount type=bind,source=#{`pwd`.chomp},target=/var/www/ruby-#{ruby_short}/#{@opts.database}/redmine-#{@opts.redmine}/plugins/#{@opts.plugin} redmineup/#{@opts.plugin} /root/run_local.sh"
19
+ execute(cmd)
20
+ end
21
+
22
+ private
23
+
24
+ def execute(cmd)
17
25
  puts "Running:\n#{cmd}"
18
- puts `#{cmd}`
26
+ Open3.popen3(cmd) do |stdout|
27
+ while (line = stdout.gets)
28
+ puts line
29
+ end
30
+ end
19
31
  end
20
32
  end
21
33
  end
data/lib/cirun/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cirun
2
- VERSION = '0.1.13'.freeze
2
+ VERSION = '0.1.14'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cirun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Malyshev