-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRakefile
291 lines (246 loc) · 7.04 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
directory 'target'
# Export path for box
def target(box)
return "target/#{box}.box"
end
boxes = [
'python', 'ruby', 'jruby', 'java', 'nodejs',
'pandas', 'pylucene', 'refine', 'refinebeta', 'r', 'bugs', 'sage', 'octave', 'vowpalwabbit', 'datavis', 'saiku',
'mysql', 'infinidb', 'elasticsearch', 'mongodb', 'neo4j', 'postgresql',
'nginx',
'tomcat',
'hadoop',
'phantomjs', 'slimerjs', 'casperjs', 'tabula', 'ocr',
'dev', 'boxgrinder'
]
puppetfiles = FileList['site.pp', 'modules/**/*']
################################################################################
# Build Tasks
################################################################################
task :default => boxes.map { |box| target(box) }
task :clean do
sh 'vagrant destroy -f'
boxes.each do |box|
sh "vagrant box remove #{box} virtualbox || true"
end
sh 'rm -fr target'
end
boxes.each do |box|
# Target for exporting a box is the destination location in target/
file target(box) => (['target'] + puppetfiles) do
sh "vagrant destroy -f #{box}"
sh "vagrant box remove #{box} virtualbox || true"
sh "vagrant up #{box}"
sh "rm -f #{target(box)}"
sh "vagrant package #{box} --output #{target(box)}"
sh "vagrant destroy -f #{box}"
end
end
task :lint do
sh 'puppet-lint --with-filename modules/infinite_interns'
end
################################################################################
# Tests
################################################################################
# TODO: Aggregate into single :test target
# TODO: Organise dependencies on boxes so no rebuilding
task :test => [
:test_python, :test_ruby, :test_jruby, :test_java, :test_nodejs,
:test_pandas, :test_pylucene, :test_refine, :test_refinebeta, :test_r, :test_bugs, :test_sage,
:test_octave, :test_vowpalwabbit, :test_datavis, :test_saiku,
:test_mysql, :test_infinidb, :test_elasticsearch, :test_mongodb, :test_neo4j,
:test_postgresql,
:test_nginx,
:test_tomcat,
:test_hadoop,
:test_phantomjs, :test_slimerjs, :test_casperjs, :test_tabula, :test_ocr,
:test_dev, :test_boxgrinder
]
# TODO: Make tests into: rake test <box>
task :test_python => ['python'] do
# TODO: Add tests
sh 'vagrant ssh python -c "python --version"'
# Check extra python libraries installed
# Check ipython-notebook socket
sh 'vagrant destroy -f python'
end
task :test_ruby => ['ruby'] do
sh 'vagrant ssh ruby -c "ruby --version"'
sh 'vagrant ssh ruby -c "rake --version"'
sh 'vagrant ssh ruby -c "irb --version"'
sh 'vagrant ssh ruby -c "gem --version"'
sh 'vagrant destroy -f ruby'
end
task :test_jruby => ['jruby'] do
# TODO: Include java box tests
sh 'vagrant ssh jruby -c "/usr/local/rvm/bin/rvm version"'
sh 'vagrant ssh jruby -c "jruby --version"'
sh 'vagrant destroy -f jruby'
end
task :test_java => ['java'] do
sh 'vagrant ssh java -c "java -version"'
sh 'vagrant destroy -f java'
end
task :test_nodejs => ['nodejs'] do
# TODO: Add tests
# Check nodejs executable
sh 'vagrant destroy -f nodejs'
end
task :test_pandas => ['pandas'] do
# TODO: Include python box tests
# TODO: Add tests
sh 'vagrant destroy -f pandas'
end
task :test_pylucene => ['pylucene'] do
# TODO: Add tests
sh 'vagrant ssh pylucene -c "python --version"'
# Check extra python libraries installed
# Check ipython-notebook socket
sh 'vagrant destroy -f pylucene'
end
task :test_refine => ['refine'] do
# TODO: Include java box tests
# TODO: Add tests
# Check refine socket
sh 'vagrant destroy -f refine'
end
task :test_refinebeta => ['refinebeta'] do
# TODO: Include java box tests
# TODO: Add tests
# Check refine socket
sh 'vagrant destroy -f refinebeta'
end
task :test_r => ['r'] do
# TODO: Add tests
# Check r executable
# Check RStudio executable
sh 'vagrant destroy -f r'
end
task :test_bugs => ['bugs'] do
# TODO: Include java box tests
# TODO: Add tests
# Check OpenBUGS executable
# Check JAGS executable
sh 'vagrant destroy -f bugs'
end
task :test_sage => ['sage'] do
# TODO: Include bayes box tests
# TODO: Add tests
# Check sage executable
# Check sage socket
# Check extra R packages
sh 'vagrant destroy -f sage'
end
task :test_octave => ['octave'] do
# TODO: Add tests
# Check octave executable
# Check gnuplot executable
sh 'vagrant destroy -f octave'
end
task :test_vowpalwabbit => ['vowpalwabbit'] do
sh 'vagrant ssh vowpalwabbit -c "vw --version"'
sh 'vagrant destroy -f vowpalwabbit'
end
task :test_datavis => ['datavis'] do
# TODO: Add tests
# Check graphviz executable
sh 'vagrant destroy -f datavis'
end
task :test_saiku => ['saiku'] do
# TODO: Add tests
# Check infinidb and tomcat tests
sh 'vagrant destroy -f saiku'
end
task :test_mysql => ['mysql'] do
# TODO: Add tests
# Check mysql executable
# Check mysql socket
sh 'vagrant destroy -f mysql'
end
task :test_elasticsearch => ['elasticsearch'] do
# TODO: Include java box tests
# TODO: Add tests
# Check elasticsearch executable
# Check elasticsearch socket
# Check plugins
sh 'vagrant destroy -f elasticsearch'
end
task :test_mongodb => ['mongodb'] do
# TODO: Add tests
# Check mongodb executable
# Check mongodb socket
sh 'vagrant destroy -f mongodb'
end
task :test_neo4j => ['neo4j'] do
# TODO: Include java box tests
# TODO: Add tests
# Check neo4j executable
# Check neo4j socket
sh 'vagrant destroy -f neo4j'
end
task :test_postgresql => ['postgresql'] do
# TODO: Add tests
# Check postgresql executable
# Check postgresql socket
sh 'vagrant destroy -f postgresql'
end
task :test_nginx => ['nginx'] do
# TODO: Add tests
# Check nginx executable
# Check nginx socket
# Check default site
sh 'vagrant destroy -f nginx'
end
task :test_tomcat => ['tomcat'] do
# TODO: Add tests
# Check tomcat executable
# Check tomcat socket
sh 'vagrant destroy -f tomcat'
end
task :test_hadoop => ['hadoop'] do
# TODO: Include java box tests
# TODO: Add tests
# Check hadoop executable
# Check hadoop sockets
# Check test job
sh 'vagrant destroy -f hadoop'
end
task :test_phantomjs => ['phantomjs'] do
# TODO: Add tests
# Check phantomjs executable
sh 'vagrant destroy -f phantomjs'
end
task :test_slimerjs => ['slimerjs'] do
# TODO: Add tests
# Check slimerjs executable
sh 'vagrant destroy -f slimerjs'
end
task :test_casperjs => ['casperjs'] do
# TODO: Add tests
# Include tests for phantomjs
# Include tests for slimerjs
# Check casperjs executable
sh 'vagrant destroy -f casperjs'
end
task :test_tabula => ['tabula'] do
# TODO: Add tests
# Check tabula executable
sh 'vagrant destroy -f tabula'
end
task :test_ocr => ['ocr'] do
# TODO: Add tests
# Check tesseract-ocr executable
sh 'vagrant destroy -f ocr'
end
task :test_dev => ['dev'] do
# TODO: Include ruby box tests
sh 'vagrant ssh dev -c "git --version"'
sh 'vagrant ssh dev -c "puppet-lint --version"'
sh 'vagrant ssh dev -c "librarian-puppet version"'
sh 'vagrant destroy -f dev'
end
task :test_dev => ['boxgrinder'] do
# TODO: Add tests
# Check boxgrinder executable
sh 'vagrant destroy -f boxgrinder'
end