drydocker 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.rubocop.yml +5 -0
- data/Dockerfile +9 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +115 -0
- data/LICENSE.txt +20 -0
- data/README.md +30 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/bin/drydocker +51 -0
- data/lib/drydocker.rb +102 -0
- data/spec/drydocker_spec.rb +65 -0
- data/spec/spec_helper.rb +8 -0
- data/test/helper.rb +34 -0
- data/test/test_loop_test.rb +7 -0
- data/wercker.yml +27 -0
- metadata +188 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e78d6667530da667826cc013e716b82c4bfa651f
|
4
|
+
data.tar.gz: 03c9698e280aef2912b5db035ff3525b281e6507
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0b32026469add8dafa927cbbbe33e39281cbae3baf968f0f90dbf44ef9bbffebc00bca7ff203bb00c4d5b1d2a0e32db0d394b0728f27ac61faebb6ad4476eeb6
|
7
|
+
data.tar.gz: 659dc23e7e1366ef69c6a3e5e0c4a9714b286cae958b4fbe2733964e269ab899b4e39387eea476e97d48d74ac02a7761b5309b5a415d8d03777ee4ebbbbd7dbc
|
data/.document
ADDED
data/.rubocop.yml
ADDED
data/Dockerfile
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
gem 'listen', '~> 2.8'
|
7
|
+
gem 'ptools', '~> 1.3'
|
8
|
+
|
9
|
+
# Add dependencies to develop your gem here.
|
10
|
+
# Include everything needed to run rake, tests, features, etc.
|
11
|
+
group :development do
|
12
|
+
gem 'shoulda', '~> 3.5'
|
13
|
+
gem 'rdoc', '~> 3.12'
|
14
|
+
gem 'bundler', '~> 1.0'
|
15
|
+
gem 'jeweler', '~> 2.0'
|
16
|
+
gem 'simplecov', '~> 0.9'
|
17
|
+
gem 'rspec', '~> 3.1'
|
18
|
+
gem 'fuubar', '~> 2.0'
|
19
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (4.2.0)
|
5
|
+
i18n (~> 0.7)
|
6
|
+
json (~> 1.7, >= 1.7.7)
|
7
|
+
minitest (~> 5.1)
|
8
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
9
|
+
tzinfo (~> 1.1)
|
10
|
+
addressable (2.3.6)
|
11
|
+
builder (3.2.2)
|
12
|
+
celluloid (0.16.0)
|
13
|
+
timers (~> 4.0.0)
|
14
|
+
descendants_tracker (0.0.4)
|
15
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
16
|
+
diff-lcs (1.2.5)
|
17
|
+
docile (1.1.5)
|
18
|
+
faraday (0.9.1)
|
19
|
+
multipart-post (>= 1.2, < 3)
|
20
|
+
ffi (1.9.6)
|
21
|
+
fuubar (2.0.0)
|
22
|
+
rspec (~> 3.0)
|
23
|
+
ruby-progressbar (~> 1.4)
|
24
|
+
git (1.2.8)
|
25
|
+
github_api (0.12.2)
|
26
|
+
addressable (~> 2.3)
|
27
|
+
descendants_tracker (~> 0.0.4)
|
28
|
+
faraday (~> 0.8, < 0.10)
|
29
|
+
hashie (>= 3.3)
|
30
|
+
multi_json (>= 1.7.5, < 2.0)
|
31
|
+
nokogiri (~> 1.6.3)
|
32
|
+
oauth2
|
33
|
+
hashie (3.3.2)
|
34
|
+
highline (1.6.21)
|
35
|
+
hitimes (1.2.2)
|
36
|
+
i18n (0.7.0)
|
37
|
+
jeweler (2.0.1)
|
38
|
+
builder
|
39
|
+
bundler (>= 1.0)
|
40
|
+
git (>= 1.2.5)
|
41
|
+
github_api
|
42
|
+
highline (>= 1.6.15)
|
43
|
+
nokogiri (>= 1.5.10)
|
44
|
+
rake
|
45
|
+
rdoc
|
46
|
+
json (1.8.2)
|
47
|
+
jwt (1.2.0)
|
48
|
+
listen (2.8.5)
|
49
|
+
celluloid (>= 0.15.2)
|
50
|
+
rb-fsevent (>= 0.9.3)
|
51
|
+
rb-inotify (>= 0.9)
|
52
|
+
mini_portile (0.6.2)
|
53
|
+
minitest (5.5.0)
|
54
|
+
multi_json (1.10.1)
|
55
|
+
multi_xml (0.5.5)
|
56
|
+
multipart-post (2.0.0)
|
57
|
+
nokogiri (1.6.5)
|
58
|
+
mini_portile (~> 0.6.0)
|
59
|
+
oauth2 (1.0.0)
|
60
|
+
faraday (>= 0.8, < 0.10)
|
61
|
+
jwt (~> 1.0)
|
62
|
+
multi_json (~> 1.3)
|
63
|
+
multi_xml (~> 0.5)
|
64
|
+
rack (~> 1.2)
|
65
|
+
ptools (1.3.2)
|
66
|
+
rack (1.6.0)
|
67
|
+
rake (10.4.2)
|
68
|
+
rb-fsevent (0.9.4)
|
69
|
+
rb-inotify (0.9.5)
|
70
|
+
ffi (>= 0.5.0)
|
71
|
+
rdoc (3.12.2)
|
72
|
+
json (~> 1.4)
|
73
|
+
rspec (3.1.0)
|
74
|
+
rspec-core (~> 3.1.0)
|
75
|
+
rspec-expectations (~> 3.1.0)
|
76
|
+
rspec-mocks (~> 3.1.0)
|
77
|
+
rspec-core (3.1.7)
|
78
|
+
rspec-support (~> 3.1.0)
|
79
|
+
rspec-expectations (3.1.2)
|
80
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
+
rspec-support (~> 3.1.0)
|
82
|
+
rspec-mocks (3.1.3)
|
83
|
+
rspec-support (~> 3.1.0)
|
84
|
+
rspec-support (3.1.2)
|
85
|
+
ruby-progressbar (1.7.1)
|
86
|
+
shoulda (3.5.0)
|
87
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
88
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
89
|
+
shoulda-context (1.2.1)
|
90
|
+
shoulda-matchers (2.7.0)
|
91
|
+
activesupport (>= 3.0.0)
|
92
|
+
simplecov (0.9.1)
|
93
|
+
docile (~> 1.1.0)
|
94
|
+
multi_json (~> 1.0)
|
95
|
+
simplecov-html (~> 0.8.0)
|
96
|
+
simplecov-html (0.8.0)
|
97
|
+
thread_safe (0.3.4)
|
98
|
+
timers (4.0.1)
|
99
|
+
hitimes
|
100
|
+
tzinfo (1.2.2)
|
101
|
+
thread_safe (~> 0.1)
|
102
|
+
|
103
|
+
PLATFORMS
|
104
|
+
ruby
|
105
|
+
|
106
|
+
DEPENDENCIES
|
107
|
+
bundler (~> 1.0)
|
108
|
+
fuubar (~> 2.0)
|
109
|
+
jeweler (~> 2.0)
|
110
|
+
listen (~> 2.8)
|
111
|
+
ptools (~> 1.3)
|
112
|
+
rdoc (~> 3.12)
|
113
|
+
rspec (~> 3.1)
|
114
|
+
shoulda (~> 3.5)
|
115
|
+
simplecov (~> 0.9)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2015 Kevin Littlejohn
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# drydocker
|
2
|
+
|
3
|
+
A project to provide a simple continuous testing tool.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Drydocker can be installed as a gem (`gem install drydocker`), or as a docker
|
8
|
+
image (`docker pull silarsis/drydocker`)
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
If installed as a gem, you will have a `drydocker` executable. If installed as
|
13
|
+
a docker image, your command to run drydocker is `docker run -it silarsis/drydocker`
|
14
|
+
|
15
|
+
In either case, running with `-h` will provide up-to-date usage instructions.
|
16
|
+
|
17
|
+
## Contributing to drydocker
|
18
|
+
|
19
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
20
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
21
|
+
* Fork the project.
|
22
|
+
* Start a feature/bugfix branch.
|
23
|
+
* Commit and push until you are happy with your contribution.
|
24
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
25
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
26
|
+
|
27
|
+
## Copyright
|
28
|
+
|
29
|
+
Copyright (c) 2015 Kevin Littlejohn. See LICENSE.txt for
|
30
|
+
further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts 'Run `bundle install` to install missing gems'
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
gem.name = 'drydocker'
|
17
|
+
gem.homepage = 'http://github.com/silarsis/drydocker'
|
18
|
+
gem.license = 'MIT'
|
19
|
+
gem.summary = 'Test something in a loop, in a docker container'
|
20
|
+
gem.description = 'Run tests on change in a docker container continuously'
|
21
|
+
gem.email = 'kevin@littlejohn.id.au'
|
22
|
+
gem.authors = ['Kevin Littlejohn']
|
23
|
+
# dependencies defined in Gemfile
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
desc 'Code coverage detail'
|
28
|
+
task :simplecov do
|
29
|
+
ENV['COVERAGE'] = 'true'
|
30
|
+
Rake::Task['test'].execute
|
31
|
+
end
|
32
|
+
|
33
|
+
task default: :test
|
34
|
+
|
35
|
+
require 'rdoc/task'
|
36
|
+
Rake::RDocTask.new do |rdoc|
|
37
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ''
|
38
|
+
|
39
|
+
rdoc.rdoc_dir = 'rdoc'
|
40
|
+
rdoc.title = "drydocker #{version}"
|
41
|
+
rdoc.rdoc_files.include('README*')
|
42
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
43
|
+
end
|
44
|
+
|
45
|
+
namespace :build do
|
46
|
+
desc 'Build the Docker container'
|
47
|
+
task :docker do
|
48
|
+
system('docker build -t silarsis/drydocker .')
|
49
|
+
end
|
50
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/bin/drydocker
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'drydocker'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
# Command line parser to setup options
|
7
|
+
# :name, :command, :image, :entrypoint, :path
|
8
|
+
class DrydockerOptions
|
9
|
+
def self.parse(args)
|
10
|
+
options = Drydocker::Config.default_config
|
11
|
+
|
12
|
+
opt_parser = OptionParser.new do |opts|
|
13
|
+
opts.banner = 'Usage: drydocker [options]'
|
14
|
+
opts.separator ''
|
15
|
+
opts.separator 'Specific options:'
|
16
|
+
|
17
|
+
opts.on('-f', '--filename [FILENAME]', 'File of options to load') do |fn|
|
18
|
+
options.load(fn)
|
19
|
+
end
|
20
|
+
|
21
|
+
opts.on('-n', '--name [NAME]') do |name|
|
22
|
+
options[:name] = name
|
23
|
+
end
|
24
|
+
|
25
|
+
opts.on('-c', '--command [COMMAND]') do |cmd|
|
26
|
+
options[:command] = cmd
|
27
|
+
end
|
28
|
+
|
29
|
+
opts.on('-i', '--image [IMAGE]') do |img|
|
30
|
+
options[:image] = img
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on('-e', '--entrypoint [ENTRYPOINT]') do |entry|
|
34
|
+
options[:entrypoint] = entry
|
35
|
+
end
|
36
|
+
|
37
|
+
opts.on('-p', '--path [PATH]') do |path|
|
38
|
+
options[:path] = path
|
39
|
+
end
|
40
|
+
end
|
41
|
+
opt_parser.parse!(args)
|
42
|
+
options
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
options = DrydockerOptions.parse(ARGV)
|
47
|
+
config = Drydocker::Config.new(options)
|
48
|
+
monitor = Drydocker::Monitor.new(config)
|
49
|
+
monitor.clean_containers
|
50
|
+
monitor.listen
|
51
|
+
sleep
|
data/lib/drydocker.rb
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'listen'
|
2
|
+
require 'ptools'
|
3
|
+
|
4
|
+
module Drydock
|
5
|
+
# Configuration file reader
|
6
|
+
class Config
|
7
|
+
attr_reader :name, :command, :image, :entrypoint, :path
|
8
|
+
|
9
|
+
def self.default_config
|
10
|
+
{
|
11
|
+
name: nil,
|
12
|
+
image: 'silarsis/drydocker',
|
13
|
+
command: 'rspec spec',
|
14
|
+
entrypoint: nil,
|
15
|
+
path: `pwd`.strip
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(params = {})
|
20
|
+
config = Config.default_config.merge(params)
|
21
|
+
@name = config[:name] || "#{config[:image]}-test"
|
22
|
+
@entrypoint = config[:entrypoint]
|
23
|
+
@image = config[:image]
|
24
|
+
@command = config[:command]
|
25
|
+
@path = config[:path]
|
26
|
+
@testing = config[:testing]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Class to actually run the monitor and tests
|
31
|
+
class Monitor
|
32
|
+
attr_accessor :config
|
33
|
+
|
34
|
+
def initialize(config)
|
35
|
+
@config = config
|
36
|
+
end
|
37
|
+
|
38
|
+
def listen
|
39
|
+
listener = Listen.to(config.path) do |modified, added, removed|
|
40
|
+
puts "triggering change: #{modified + added + removed}"
|
41
|
+
run_or_start
|
42
|
+
end
|
43
|
+
listener.start # not blocking
|
44
|
+
end
|
45
|
+
|
46
|
+
def clean_containers
|
47
|
+
fail 'No docker found' if File.which('docker').nil?
|
48
|
+
return unless system("docker ps | grep #{config.name}")
|
49
|
+
`docker kill #{config.name}`
|
50
|
+
`docker rm #{config.name}`
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
|
55
|
+
def docker_run_cmd
|
56
|
+
%W(
|
57
|
+
#{docker_cmd} #{name_opt} #{path_opt} #{entrypoint_opt} #{config.image}
|
58
|
+
#{command}
|
59
|
+
).reject { |x| x == '' }.join(' ')
|
60
|
+
end
|
61
|
+
|
62
|
+
def docker_start_cmd
|
63
|
+
"docker start -ai #{config.name}"
|
64
|
+
end
|
65
|
+
|
66
|
+
def docker_check_cmd
|
67
|
+
"docker ps -a | grep #{config.name} >/dev/null"
|
68
|
+
end
|
69
|
+
|
70
|
+
def docker_cmd
|
71
|
+
'docker run -it'
|
72
|
+
end
|
73
|
+
|
74
|
+
def name_opt
|
75
|
+
"--name #{config.name}"
|
76
|
+
end
|
77
|
+
|
78
|
+
def entrypoint_opt
|
79
|
+
config.entrypoint.nil? ? '' : "--entrypoint #{config.entrypoint}"
|
80
|
+
end
|
81
|
+
|
82
|
+
def path_opt
|
83
|
+
"-v #{config.path}:/app"
|
84
|
+
end
|
85
|
+
|
86
|
+
def command
|
87
|
+
config.command.nil? ? '' : config.command
|
88
|
+
end
|
89
|
+
|
90
|
+
def run
|
91
|
+
system(docker_run_cmd)
|
92
|
+
end
|
93
|
+
|
94
|
+
def start
|
95
|
+
system(docker_start_cmd)
|
96
|
+
end
|
97
|
+
|
98
|
+
def run_or_start
|
99
|
+
system(docker_check_cmd) ? start : run
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'drydocker'
|
3
|
+
|
4
|
+
# Tests for the main module
|
5
|
+
module Drydock
|
6
|
+
describe Config do
|
7
|
+
context 'with basic configuration' do
|
8
|
+
let(:config) { Config.new }
|
9
|
+
specify { expect(config.name).to eq 'silarsis/drydocker-test' }
|
10
|
+
specify { expect(config.entrypoint).to be_nil }
|
11
|
+
specify { expect(config.image).to eq 'silarsis/drydocker' }
|
12
|
+
specify { expect(config.command).to eq 'rspec spec' }
|
13
|
+
end
|
14
|
+
context 'with provide value for' do
|
15
|
+
context 'name' do
|
16
|
+
let(:config) { Config.new(name: 'args-test') }
|
17
|
+
specify { expect(config.name).to eq 'args-test' }
|
18
|
+
end
|
19
|
+
context 'command' do
|
20
|
+
let(:config) { Config.new(command: 'args-test') }
|
21
|
+
specify { expect(config.command).to eq 'args-test' }
|
22
|
+
end
|
23
|
+
context 'image' do
|
24
|
+
let(:config) { Config.new(image: 'args-test') }
|
25
|
+
specify { expect(config.image).to eq 'args-test' }
|
26
|
+
end
|
27
|
+
context 'entrypoint' do
|
28
|
+
let(:config) { Config.new(entrypoint: 'args-test') }
|
29
|
+
specify { expect(config.entrypoint).to eq 'args-test' }
|
30
|
+
end
|
31
|
+
context 'path' do
|
32
|
+
let(:config) { Config.new(path: 'args-test') }
|
33
|
+
specify { expect(config.path).to eq 'args-test' }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe Monitor do
|
39
|
+
let(:config) { Drydock::Config.new }
|
40
|
+
let(:monitor) { Monitor.new(config) }
|
41
|
+
|
42
|
+
describe '#monitor' do
|
43
|
+
it 'should run the docker container the first time' do
|
44
|
+
expect(monitor).to receive(:system) \
|
45
|
+
.with("docker ps -a | grep #{config.name} >/dev/null") \
|
46
|
+
.and_return false
|
47
|
+
expect(monitor).to receive(:system) \
|
48
|
+
.with("docker run -it --name #{config.name} -v #{config.path}:/app #{config.image} #{config.command}") \
|
49
|
+
.and_return true
|
50
|
+
monitor.send(:run_or_start)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should start the docker container the second time' do
|
54
|
+
expect(monitor).to receive(:system) \
|
55
|
+
.with("docker ps -a | grep #{config.name} >/dev/null") \
|
56
|
+
.and_return true
|
57
|
+
expect(monitor).to receive(:system) \
|
58
|
+
.with("docker start -ai #{config.name}") \
|
59
|
+
.and_return true
|
60
|
+
monitor.send(:run_or_start)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/test/helper.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
|
3
|
+
module SimpleCov::Configuration
|
4
|
+
def clean_filters
|
5
|
+
@filters = []
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
SimpleCov.configure do
|
10
|
+
clean_filters
|
11
|
+
load_adapter 'test_frameworks'
|
12
|
+
end
|
13
|
+
|
14
|
+
ENV["COVERAGE"] && SimpleCov.start do
|
15
|
+
add_filter "/.rvm/"
|
16
|
+
end
|
17
|
+
require 'rubygems'
|
18
|
+
require 'bundler'
|
19
|
+
begin
|
20
|
+
Bundler.setup(:default, :development)
|
21
|
+
rescue Bundler::BundlerError => e
|
22
|
+
$stderr.puts e.message
|
23
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
24
|
+
exit e.status_code
|
25
|
+
end
|
26
|
+
require 'test/unit'
|
27
|
+
require 'shoulda'
|
28
|
+
|
29
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
30
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
31
|
+
require 'drydocker'
|
32
|
+
|
33
|
+
class Test::Unit::TestCase
|
34
|
+
end
|
data/wercker.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
box: wercker/rvm
|
2
|
+
# Build definition
|
3
|
+
build:
|
4
|
+
# The steps that will be executed on build
|
5
|
+
# See the Ruby section on the wercker devcenter:
|
6
|
+
# http://devcenter.wercker.com/articles/languages/ruby.html
|
7
|
+
steps:
|
8
|
+
# Uncomment this to force RVM to use a specific Ruby version
|
9
|
+
# - rvm-use:
|
10
|
+
# version: 2.2.0
|
11
|
+
|
12
|
+
# A step that executes `bundle install` command
|
13
|
+
- bundle-install
|
14
|
+
|
15
|
+
# A custom script step, name value is used in the UI
|
16
|
+
# and the code value contains the command that get executed
|
17
|
+
- script:
|
18
|
+
name: echo ruby information
|
19
|
+
code: |
|
20
|
+
echo "ruby version $(ruby --version) running"
|
21
|
+
echo "from location $(which ruby)"
|
22
|
+
echo -p "gem list: $(gem list)"
|
23
|
+
|
24
|
+
# Add more steps here:
|
25
|
+
- script:
|
26
|
+
name: rspec
|
27
|
+
code: bundle exec rspec spec
|
metadata
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: drydocker
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Littlejohn
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: listen
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.8'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ptools
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: shoulda
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rdoc
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jeweler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.9'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.9'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.1'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.1'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fuubar
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.0'
|
139
|
+
description: Run tests on change in a docker container continuously
|
140
|
+
email: kevin@littlejohn.id.au
|
141
|
+
executables:
|
142
|
+
- drydocker
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files:
|
145
|
+
- LICENSE.txt
|
146
|
+
- README.md
|
147
|
+
files:
|
148
|
+
- ".document"
|
149
|
+
- ".rubocop.yml"
|
150
|
+
- Dockerfile
|
151
|
+
- Gemfile
|
152
|
+
- Gemfile.lock
|
153
|
+
- LICENSE.txt
|
154
|
+
- README.md
|
155
|
+
- Rakefile
|
156
|
+
- VERSION
|
157
|
+
- bin/drydocker
|
158
|
+
- lib/drydocker.rb
|
159
|
+
- spec/drydocker_spec.rb
|
160
|
+
- spec/spec_helper.rb
|
161
|
+
- test/helper.rb
|
162
|
+
- test/test_loop_test.rb
|
163
|
+
- wercker.yml
|
164
|
+
homepage: http://github.com/silarsis/drydocker
|
165
|
+
licenses:
|
166
|
+
- MIT
|
167
|
+
metadata: {}
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
require_paths:
|
171
|
+
- lib
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
requirements: []
|
183
|
+
rubyforge_project:
|
184
|
+
rubygems_version: 2.2.2
|
185
|
+
signing_key:
|
186
|
+
specification_version: 4
|
187
|
+
summary: Test something in a loop, in a docker container
|
188
|
+
test_files: []
|