cirun 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cirun/runner.rb +14 -2
- data/lib/cirun/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e20d4dbe347265c9858ccb17382908c84aa50f5ed9ccf4302e81e032b9aeb42c
|
4
|
+
data.tar.gz: 6fb7ec33e53ad2a7c7160a3bed903b335d5497c3116a4a6691c86252dbb26bbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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