forked from minrk/iruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
41 lines (34 loc) · 944 Bytes
/
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
require 'rake/testtask'
begin
require 'bundler/gem_tasks'
rescue Exception
end
FileList['tasks/**.rake'].each {|f| load f }
Rake::TestTask.new('test') do |t|
t.libs << 'lib'
t.libs << 'test'
t.test_files = FileList['test/**/*_test.rb']
t.verbose = true
end
task default: 'test'
namespace :docker do
def root_dir
@root_dir ||= File.expand_path("..", __FILE__)
end
task :build do
container_name = "iruby_build"
image_name = "mrkn/iruby"
sh "docker", "run",
"--name", container_name,
"-v", "#{root_dir}:/tmp/iruby",
"rubylang/ruby", "/bin/bash", "/tmp/iruby/docker/setup.sh"
sh "docker", "commit", container_name, image_name
sh "docker", "rm", container_name
end
task :test do
root_dir = File.expand_path("..", __FILE__)
sh "docker", "run", "-it", "--rm",
"-v", "#{root_dir}:/tmp/iruby",
"mrkn/iruby", "/bin/bash", "/tmp/iruby/docker/test.sh"
end
end