dockerfiroonga 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/dockerfiroonga/command.rb +58 -15
- data/lib/dockerfiroonga/platform.rb +3 -4
- data/lib/dockerfiroonga/platform/base.rb +2 -1
- data/lib/dockerfiroonga/platform/centos.rb +38 -0
- data/lib/dockerfiroonga/platform/debian.rb +78 -0
- data/lib/dockerfiroonga/version.rb +1 -1
- data/test/test-command.rb +137 -19
- metadata +4 -5
- data/lib/dockerfiroonga/platform/debian_sid.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da61263a54fd05b5de7d3a400b3e7a1c4d015897
|
4
|
+
data.tar.gz: 37fb0454621c7044ae5d3e64b636ec00b2dd3757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 082ef90734103327e6bc408dab0ead06893f468743355bf9638b19a57771d5f642732b238350cf62df604ca0c581fb3b5e1abf8266f1be6b72f180d734cec807
|
7
|
+
data.tar.gz: 7864e34103c6e66d9b98fb4380bcf662c9ef6fa0b524c61e697868a71a327fb85475461b278909ab463debcc7ef280eba3d2e06ccf578896beef8fd7680808a2
|
data/README.md
CHANGED
@@ -1,40 +1,83 @@
|
|
1
|
+
require "optparse"
|
1
2
|
require "dockerfiroonga/platform"
|
3
|
+
require "dockerfiroonga/version"
|
2
4
|
|
3
5
|
module Dockerfiroonga
|
4
6
|
class Command
|
5
|
-
|
6
|
-
|
7
|
-
end
|
8
|
-
|
9
|
-
def initialize(arguments)
|
10
|
-
if arguments.empty? or /-h|--help/ =~ arguments[0]
|
11
|
-
$stdout.puts(<<-END_OF_USAGE)
|
12
|
-
Usage: dockerfiroonga PLATFORM [Xroonga]
|
7
|
+
USAGE = <<-END_OF_USAGE
|
8
|
+
Usage: dockerfiroonga [OPTIONS] PLATFORM [Xroonga]
|
13
9
|
PLATFORM:
|
14
|
-
* debian:
|
10
|
+
* debian[:wheezy] (APT)
|
11
|
+
* debian:XXX (.tar.gz)
|
15
12
|
* ubuntu (PPA)
|
16
13
|
* centos (yum)
|
17
14
|
Xroonga:
|
18
15
|
* groonga (default)
|
19
16
|
* rroonga
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
END_OF_USAGE
|
18
|
+
|
19
|
+
def self.run(arguments)
|
20
|
+
new(arguments).run
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(arguments)
|
24
|
+
@options = parse_options(arguments)
|
25
|
+
|
23
26
|
@platform_name = arguments[0]
|
24
|
-
|
27
|
+
begin
|
28
|
+
@platform = Platform.new(@platform_name)
|
29
|
+
rescue ArgumentError
|
30
|
+
$stderr.puts("This platform is not supported yet: <#{@platform_name}>")
|
31
|
+
$stderr.puts(USAGE)
|
32
|
+
exit(false)
|
33
|
+
end
|
34
|
+
|
25
35
|
@_roonga = arguments[1] || "groonga"
|
26
36
|
unless @platform.respond_to?("installation_#{@_roonga}")
|
27
|
-
|
37
|
+
$stderr.puts("This Xroonga is not supported yet: <#{@_roonga}>")
|
38
|
+
$stderr.puts(USAGE)
|
39
|
+
exit(false)
|
28
40
|
end
|
41
|
+
|
42
|
+
@maintainer = @options[:maintainer] ||
|
43
|
+
"Masafumi Yokoyama <yokoyama@clear-code.com>"
|
29
44
|
end
|
30
45
|
|
31
46
|
def run
|
32
47
|
puts <<-END_OF_FILE
|
33
48
|
FROM #{@platform_name}
|
34
|
-
MAINTAINER
|
49
|
+
MAINTAINER #{@maintainer}
|
35
50
|
#{@platform.__send__("installation_#{@_roonga}")}
|
36
51
|
CMD ["groonga", "--version"]
|
37
52
|
END_OF_FILE
|
38
53
|
end
|
54
|
+
|
55
|
+
private
|
56
|
+
def parse_options(arguments)
|
57
|
+
options = {}
|
58
|
+
|
59
|
+
parser = OptionParser.new(<<-END_OF_BANNER)
|
60
|
+
#{USAGE.chomp}
|
61
|
+
OPTIONS:
|
62
|
+
END_OF_BANNER
|
63
|
+
|
64
|
+
parser.version = VERSION
|
65
|
+
|
66
|
+
parser.on("-h", "--help", "Show usage") do |boolean|
|
67
|
+
puts(parser.help)
|
68
|
+
exit(true)
|
69
|
+
end
|
70
|
+
parser.on("--maintainer=NAME", "Set maintainer") do |name|
|
71
|
+
options[:maintainer] = name
|
72
|
+
end
|
73
|
+
parser.parse!(arguments)
|
74
|
+
|
75
|
+
if arguments.empty?
|
76
|
+
puts(parser.help)
|
77
|
+
exit(true)
|
78
|
+
end
|
79
|
+
|
80
|
+
options
|
81
|
+
end
|
39
82
|
end
|
40
83
|
end
|
@@ -2,14 +2,13 @@ module Dockerfiroonga
|
|
2
2
|
module Platform
|
3
3
|
module_function
|
4
4
|
def self.new(name)
|
5
|
-
|
5
|
+
os, version = name.split(/:/)
|
6
6
|
begin
|
7
|
-
require "dockerfiroonga/platform/#{
|
7
|
+
require "dockerfiroonga/platform/#{os}"
|
8
8
|
rescue LoadError
|
9
9
|
raise ArgumentError, "Invalid name: <#{name}>"
|
10
10
|
end
|
11
|
-
|
12
|
-
const_get(class_name).new
|
11
|
+
const_get(os.capitalize).new(version)
|
13
12
|
end
|
14
13
|
end
|
15
14
|
end
|
@@ -23,6 +23,44 @@ RUN gem install rdoc
|
|
23
23
|
RUN gem install rroonga
|
24
24
|
END_OF_INSTALLATION
|
25
25
|
end
|
26
|
+
|
27
|
+
def installation_mroonga
|
28
|
+
case @os_version
|
29
|
+
when "centos5", "5"
|
30
|
+
<<-END_OF_INSTALLATION
|
31
|
+
#{installation_groonga}
|
32
|
+
#{installation_mroonga_mysql55.chomp}
|
33
|
+
END_OF_INSTALLATION
|
34
|
+
when "centos6", "6"
|
35
|
+
<<-END_OF_INSTALLATION
|
36
|
+
#{installation_groonga}
|
37
|
+
#{installation_mroonga_mysql_community.chomp}
|
38
|
+
END_OF_INSTALLATION
|
39
|
+
else
|
40
|
+
raise ArgumentError, "Not supported: <#{@os_version}>"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
def installation_mroonga_mysql55
|
46
|
+
<<-END_OF_INSTALLATION
|
47
|
+
RUN yum install -y mysql55-mysql-server
|
48
|
+
RUN /sbin/service mysql55-mysqld start
|
49
|
+
RUN yum install -y mysql55-mroonga
|
50
|
+
END_OF_INSTALLATION
|
51
|
+
end
|
52
|
+
|
53
|
+
def installation_mroonga_mysql_community
|
54
|
+
centos_version = @os_version[-1]
|
55
|
+
|
56
|
+
<<-END_OF_INSTALLATION
|
57
|
+
RUN yum install -y http://repo.mysql.com/mysql-community-release-el#{centos_version}-5.noarch.rpm
|
58
|
+
RUN yum makecache
|
59
|
+
RUN yum install -y mysql-community-server
|
60
|
+
RUN /sbin/service mysqld start
|
61
|
+
RUN yum install -y mysql-community-mroonga
|
62
|
+
END_OF_INSTALLATION
|
63
|
+
end
|
26
64
|
end
|
27
65
|
end
|
28
66
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require "dockerfiroonga/platform/base"
|
2
|
+
|
3
|
+
module Dockerfiroonga
|
4
|
+
module Platform
|
5
|
+
class Debian
|
6
|
+
include Base
|
7
|
+
|
8
|
+
def initialize(os_version=nil)
|
9
|
+
super
|
10
|
+
@os_version ||= "wheezy"
|
11
|
+
end
|
12
|
+
|
13
|
+
def installation_groonga(version="5.0.0")
|
14
|
+
case @os_version
|
15
|
+
when "wheezy"
|
16
|
+
installation_groonga_wheezy
|
17
|
+
else
|
18
|
+
installation_groonga_source(version)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def installation_rroonga
|
23
|
+
<<-END_OF_INSTALLATION
|
24
|
+
#{installation_groonga}
|
25
|
+
RUN export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
|
26
|
+
RUN export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
27
|
+
RUN apt-get -y install ruby ruby-dev
|
28
|
+
RUN gem install rroonga
|
29
|
+
END_OF_INSTALLATION
|
30
|
+
end
|
31
|
+
|
32
|
+
def installation_mroonga(version="5.0.0")
|
33
|
+
case @os_version
|
34
|
+
when "wheezy"
|
35
|
+
<<-END_OF_INSTALLATION
|
36
|
+
#{installation_groonga}
|
37
|
+
#{installation_mroonga_wheezy.chomp}
|
38
|
+
END_OF_INSTALLATION
|
39
|
+
else
|
40
|
+
raise ArgumentError, "Not supported: <#{@os_version}>"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
def installation_groonga_wheezy
|
46
|
+
codename = "wheezy"
|
47
|
+
|
48
|
+
<<-END_OF_INSTALLATION
|
49
|
+
RUN echo "deb http://packages.groonga.org/debian/ #{codename} main" >/etc/apt/sources.list.d/groonga.list
|
50
|
+
RUN echo "deb-src http://packages.groonga.org/debian/ #{codename} main" >>/etc/apt/sources.list.d/groonga.list
|
51
|
+
RUN apt-get update
|
52
|
+
RUN apt-get install -y --allow-unauthenticated groonga-keyring
|
53
|
+
RUN apt-get update
|
54
|
+
RUN apt-get install -y -V groonga
|
55
|
+
END_OF_INSTALLATION
|
56
|
+
end
|
57
|
+
|
58
|
+
def installation_groonga_source(version)
|
59
|
+
<<-END_OF_INSTALLATION
|
60
|
+
RUN apt-get update
|
61
|
+
RUN apt-get install -y -V wget tar build-essential zlib1g-dev liblzo2-dev libmsgpack-dev libzmq-dev libevent-dev libmecab-dev
|
62
|
+
RUN wget http://packages.groonga.org/source/groonga/groonga-#{version}.tar.gz
|
63
|
+
RUN tar xvzf groonga-#{version}.tar.gz
|
64
|
+
RUN cd groonga-#{version}/ && \
|
65
|
+
./configure --prefix=/usr/local && \
|
66
|
+
make -j$(grep '^processor' /proc/cpuinfo | wc -l) && \
|
67
|
+
make install
|
68
|
+
END_OF_INSTALLATION
|
69
|
+
end
|
70
|
+
|
71
|
+
def installation_mroonga_wheezy
|
72
|
+
<<-END_OF_INSTALLATION
|
73
|
+
RUN apt-get install -y -V mysql-server-mroonga
|
74
|
+
END_OF_INSTALLATION
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
data/test/test-command.rb
CHANGED
@@ -5,25 +5,29 @@ class CommandTest < Test::Unit::TestCase
|
|
5
5
|
def setup
|
6
6
|
@platform_name = "ubuntu"
|
7
7
|
@command = Dockerfiroonga::Command.new([@platform_name])
|
8
|
-
@
|
9
|
-
|
10
|
-
|
8
|
+
@stdout_string = ""
|
9
|
+
@stderr_string = ""
|
10
|
+
stdout_io = StringIO.new(@stdout_string)
|
11
|
+
stderr_io = StringIO.new(@stderr_string)
|
12
|
+
$stdout = stdout_io
|
13
|
+
$stderr = stderr_io
|
11
14
|
end
|
12
15
|
|
13
16
|
def teardown
|
14
17
|
$stdout = STDOUT
|
18
|
+
$stderr = STDERR
|
15
19
|
end
|
16
20
|
|
17
21
|
def test_run
|
18
22
|
@command.run
|
19
23
|
assert do
|
20
|
-
@
|
24
|
+
@stdout_string.lines.first.start_with?("FROM #{@platform_name}")
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
24
28
|
def test_ubuntu
|
25
29
|
@command.run
|
26
|
-
assert_equal(<<-END_OF_FILE, @
|
30
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
27
31
|
FROM ubuntu
|
28
32
|
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
29
33
|
RUN apt-get -y install software-properties-common
|
@@ -39,7 +43,7 @@ CMD ["groonga", "--version"]
|
|
39
43
|
def test_rroonga
|
40
44
|
@command = Dockerfiroonga::Command.new([@platform_name, "rroonga"])
|
41
45
|
@command.run
|
42
|
-
assert_equal(<<-END_OF_FILE, @
|
46
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
43
47
|
FROM ubuntu
|
44
48
|
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
45
49
|
RUN apt-get -y install software-properties-common
|
@@ -57,6 +61,52 @@ CMD ["groonga", "--version"]
|
|
57
61
|
END_OF_FILE
|
58
62
|
end
|
59
63
|
|
64
|
+
class DebianWheezyTest < self
|
65
|
+
def setup
|
66
|
+
super
|
67
|
+
@platform_name = "debian:wheezy"
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_groonga
|
71
|
+
@command = Dockerfiroonga::Command.new([@platform_name, "groonga"])
|
72
|
+
@command.run
|
73
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
74
|
+
FROM debian:wheezy
|
75
|
+
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
76
|
+
RUN echo "deb http://packages.groonga.org/debian/ wheezy main" >/etc/apt/sources.list.d/groonga.list
|
77
|
+
RUN echo "deb-src http://packages.groonga.org/debian/ wheezy main" >>/etc/apt/sources.list.d/groonga.list
|
78
|
+
RUN apt-get update
|
79
|
+
RUN apt-get install -y --allow-unauthenticated groonga-keyring
|
80
|
+
RUN apt-get update
|
81
|
+
RUN apt-get install -y -V groonga
|
82
|
+
|
83
|
+
CMD ["groonga", "--version"]
|
84
|
+
END_OF_FILE
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_rroonga
|
88
|
+
@command = Dockerfiroonga::Command.new([@platform_name, "rroonga"])
|
89
|
+
@command.run
|
90
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
91
|
+
FROM debian:wheezy
|
92
|
+
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
93
|
+
RUN echo "deb http://packages.groonga.org/debian/ wheezy main" >/etc/apt/sources.list.d/groonga.list
|
94
|
+
RUN echo "deb-src http://packages.groonga.org/debian/ wheezy main" >>/etc/apt/sources.list.d/groonga.list
|
95
|
+
RUN apt-get update
|
96
|
+
RUN apt-get install -y --allow-unauthenticated groonga-keyring
|
97
|
+
RUN apt-get update
|
98
|
+
RUN apt-get install -y -V groonga
|
99
|
+
|
100
|
+
RUN apt-get install -y -V libgroonga-dev
|
101
|
+
RUN apt-get install -y -V ruby-dev
|
102
|
+
RUN apt-get install -y -V build-essential
|
103
|
+
RUN gem install rroonga
|
104
|
+
|
105
|
+
CMD ["groonga", "--version"]
|
106
|
+
END_OF_FILE
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
60
110
|
class DebianSidTest < self
|
61
111
|
def setup
|
62
112
|
super
|
@@ -67,7 +117,7 @@ CMD ["groonga", "--version"]
|
|
67
117
|
@command = Dockerfiroonga::Command.new([@platform_name, "groonga"])
|
68
118
|
@command.run
|
69
119
|
version = "5.0.0"
|
70
|
-
assert_equal(<<-END_OF_FILE, @
|
120
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
71
121
|
FROM debian:sid
|
72
122
|
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
73
123
|
RUN apt-get update
|
@@ -87,7 +137,7 @@ CMD ["groonga", "--version"]
|
|
87
137
|
@command = Dockerfiroonga::Command.new([@platform_name, "rroonga"])
|
88
138
|
@command.run
|
89
139
|
version = "5.0.0"
|
90
|
-
assert_equal(<<-END_OF_FILE, @
|
140
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
91
141
|
FROM debian:sid
|
92
142
|
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
93
143
|
RUN apt-get update
|
@@ -117,7 +167,7 @@ CMD ["groonga", "--version"]
|
|
117
167
|
def test_groonga
|
118
168
|
@command = Dockerfiroonga::Command.new([@platform_name, "groonga"])
|
119
169
|
@command.run
|
120
|
-
assert_equal(<<-END_OF_FILE, @
|
170
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
121
171
|
FROM centos
|
122
172
|
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
123
173
|
RUN rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
|
@@ -131,7 +181,7 @@ CMD ["groonga", "--version"]
|
|
131
181
|
def test_rroonga
|
132
182
|
@command = Dockerfiroonga::Command.new([@platform_name, "rroonga"])
|
133
183
|
@command.run
|
134
|
-
assert_equal(<<-END_OF_FILE, @
|
184
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
135
185
|
FROM centos
|
136
186
|
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
137
187
|
RUN rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
|
@@ -144,38 +194,106 @@ RUN yum install -y make gcc zlib-devel openssl-devel
|
|
144
194
|
RUN gem install rdoc
|
145
195
|
RUN gem install rroonga
|
146
196
|
|
197
|
+
CMD ["groonga", "--version"]
|
198
|
+
END_OF_FILE
|
199
|
+
end
|
200
|
+
|
201
|
+
def test_mroonga_centos6
|
202
|
+
@platform_name = "centos:6"
|
203
|
+
@command = Dockerfiroonga::Command.new([@platform_name, "mroonga"])
|
204
|
+
@command.run
|
205
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
206
|
+
FROM centos:6
|
207
|
+
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
208
|
+
RUN rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
|
209
|
+
RUN yum makecache
|
210
|
+
RUN yum install -y groonga
|
211
|
+
|
212
|
+
RUN yum install -y http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
|
213
|
+
RUN yum makecache
|
214
|
+
RUN yum install -y mysql-community-server
|
215
|
+
RUN /sbin/service mysqld start
|
216
|
+
RUN yum install -y mysql-community-mroonga
|
217
|
+
|
218
|
+
CMD ["groonga", "--version"]
|
219
|
+
END_OF_FILE
|
220
|
+
end
|
221
|
+
|
222
|
+
def test_mroonga_centos5
|
223
|
+
@platform_name = "centos:5"
|
224
|
+
@command = Dockerfiroonga::Command.new([@platform_name, "mroonga"])
|
225
|
+
@command.run
|
226
|
+
assert_equal(<<-END_OF_FILE, @stdout_string)
|
227
|
+
FROM centos:5
|
228
|
+
MAINTAINER Masafumi Yokoyama <yokoyama@clear-code.com>
|
229
|
+
RUN rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
|
230
|
+
RUN yum makecache
|
231
|
+
RUN yum install -y groonga
|
232
|
+
|
233
|
+
RUN yum install -y mysql55-mysql-server
|
234
|
+
RUN /sbin/service mysql55-mysqld start
|
235
|
+
RUN yum install -y mysql55-mroonga
|
236
|
+
|
147
237
|
CMD ["groonga", "--version"]
|
148
238
|
END_OF_FILE
|
149
239
|
end
|
150
240
|
end
|
151
241
|
|
152
242
|
def test_no_argument
|
153
|
-
|
154
|
-
|
243
|
+
assert_raise SystemExit do
|
244
|
+
Dockerfiroonga::Command.new([])
|
245
|
+
end
|
155
246
|
assert do
|
156
|
-
@
|
247
|
+
@stdout_string.start_with?("Usage: ")
|
157
248
|
end
|
158
249
|
end
|
159
250
|
|
160
251
|
def test_help_option_short
|
161
|
-
|
162
|
-
|
252
|
+
assert_raise SystemExit do
|
253
|
+
Dockerfiroonga::Command.new(["-h"])
|
254
|
+
end
|
163
255
|
assert do
|
164
|
-
@
|
256
|
+
@stdout_string.start_with?("Usage: ")
|
165
257
|
end
|
166
258
|
end
|
167
259
|
|
168
260
|
def test_help_option_long
|
169
|
-
|
261
|
+
assert_raise SystemExit do
|
262
|
+
Dockerfiroonga::Command.new(["--help"])
|
263
|
+
end
|
264
|
+
assert do
|
265
|
+
@stdout_string.start_with?("Usage: ")
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
def test_maintainer_option
|
270
|
+
@command = Dockerfiroonga::Command.new([
|
271
|
+
"--maintainer=Me",
|
272
|
+
@platform_name,
|
273
|
+
])
|
170
274
|
@command.run
|
275
|
+
assert_equal("MAINTAINER Me\n", @stdout_string.lines[1])
|
276
|
+
end
|
277
|
+
|
278
|
+
def test_not_supported_platform
|
279
|
+
assert_raise SystemExit do
|
280
|
+
Dockerfiroonga::Command.new(["firefox"])
|
281
|
+
end
|
282
|
+
assert_equal("This platform is not supported yet: <firefox>\n",
|
283
|
+
@stderr_string.lines[0])
|
171
284
|
assert do
|
172
|
-
@
|
285
|
+
@stderr_string.lines[1].start_with?("Usage: ")
|
173
286
|
end
|
174
287
|
end
|
175
288
|
|
176
289
|
def test_not_supported_xroonga
|
177
|
-
assert_raise
|
290
|
+
assert_raise SystemExit do
|
178
291
|
Dockerfiroonga::Command.new([@platform_name, "xxxroonga"])
|
179
292
|
end
|
293
|
+
assert_equal("This Xroonga is not supported yet: <xxxroonga>\n",
|
294
|
+
@stderr_string.lines[0])
|
295
|
+
assert do
|
296
|
+
@stderr_string.lines[1].start_with?("Usage: ")
|
297
|
+
end
|
180
298
|
end
|
181
299
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockerfiroonga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Yokoyama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -86,7 +86,7 @@ files:
|
|
86
86
|
- lib/dockerfiroonga/platform.rb
|
87
87
|
- lib/dockerfiroonga/platform/base.rb
|
88
88
|
- lib/dockerfiroonga/platform/centos.rb
|
89
|
-
- lib/dockerfiroonga/platform/
|
89
|
+
- lib/dockerfiroonga/platform/debian.rb
|
90
90
|
- lib/dockerfiroonga/platform/ubuntu.rb
|
91
91
|
- lib/dockerfiroonga/version.rb
|
92
92
|
- test/run-test.rb
|
@@ -111,11 +111,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.4.5
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Dockerfile generator for Groonga family.
|
118
118
|
test_files:
|
119
119
|
- test/run-test.rb
|
120
120
|
- test/test-command.rb
|
121
|
-
has_rdoc:
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require "dockerfiroonga/platform/base"
|
2
|
-
|
3
|
-
module Dockerfiroonga
|
4
|
-
module Platform
|
5
|
-
class DebianSid
|
6
|
-
include Base
|
7
|
-
|
8
|
-
def installation_groonga(version="5.0.0")
|
9
|
-
<<-END_OF_INSTALLATION
|
10
|
-
RUN apt-get update
|
11
|
-
RUN apt-get install -y -V wget tar build-essential zlib1g-dev liblzo2-dev libmsgpack-dev libzmq-dev libevent-dev libmecab-dev
|
12
|
-
RUN wget http://packages.groonga.org/source/groonga/groonga-#{version}.tar.gz
|
13
|
-
RUN tar xvzf groonga-#{version}.tar.gz
|
14
|
-
RUN cd groonga-#{version}/ && \
|
15
|
-
./configure --prefix=/usr/local && \
|
16
|
-
make -j$(grep '^processor' /proc/cpuinfo | wc -l) && \
|
17
|
-
make install
|
18
|
-
END_OF_INSTALLATION
|
19
|
-
end
|
20
|
-
|
21
|
-
def installation_rroonga
|
22
|
-
<<-END_OF_INSTALLATION
|
23
|
-
#{installation_groonga}
|
24
|
-
RUN export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
|
25
|
-
RUN export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
26
|
-
RUN apt-get -y install ruby ruby-dev
|
27
|
-
RUN gem install rroonga
|
28
|
-
END_OF_INSTALLATION
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|