dockly 1.13.0 → 2.0.0
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.
- data/.travis.yml +3 -7
- data/README.md +6 -4
- data/Rakefile +0 -5
- data/dockly.gemspec +0 -1
- data/lib/dockly/build_cache/base.rb +1 -2
- data/lib/dockly/build_cache/docker.rb +24 -37
- data/lib/dockly/deb.rb +15 -28
- data/lib/dockly/docker.rb +10 -55
- data/lib/dockly/rake_task.rb +10 -93
- data/lib/dockly/version.rb +1 -1
- data/lib/dockly.rb +0 -2
- data/snippets/file_diff_docker_import.erb +1 -1
- data/snippets/get_and_install_deb.erb +1 -1
- data/snippets/get_from_s3.erb +1 -1
- data/snippets/s3_diff_docker_import.erb +3 -15
- data/snippets/s3_docker_import.erb +1 -1
- data/spec/dockly/bash_builder_spec.rb +4 -4
- data/spec/dockly/build_cache/docker_spec.rb +8 -8
- data/spec/dockly/deb_spec.rb +12 -48
- data/spec/dockly/docker_spec.rb +58 -75
- data/spec/dockly/rpm_spec.rb +5 -28
- data/spec/support/vcr.rb +11 -0
- metadata +4 -22
- data/lib/dockly/history.rb +0 -64
- data/spec/dockly/history_spec.rb +0 -94
data/spec/dockly/history_spec.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Dockly::History do
|
4
|
-
describe '#duplicate_build?' do
|
5
|
-
before { allow(subject).to receive(:duplicate_build_sha).and_return(sha) }
|
6
|
-
|
7
|
-
context 'when the duplicate build sha is not present' do
|
8
|
-
let(:sha) { nil }
|
9
|
-
|
10
|
-
it 'returns false' do
|
11
|
-
expect(subject).to_not be_duplicate_build
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'when the duplicate build sha is present' do
|
16
|
-
let(:sha) { 'DEADBEEF' }
|
17
|
-
|
18
|
-
it 'returns true' do
|
19
|
-
expect(subject).to be_duplicate_build
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe '#duplicate_build_sha' do
|
25
|
-
let(:content_tag) { 'dockly-FAKE-CONTENT-HASH' }
|
26
|
-
|
27
|
-
before { allow(subject).to receive(:content_tag).and_return(content_tag) }
|
28
|
-
|
29
|
-
context 'when there is not a commit with a matching content hash' do
|
30
|
-
it 'returns nil' do
|
31
|
-
expect(subject.duplicate_build_sha).to be(nil)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'when there is a commit with a matching content hash' do
|
36
|
-
let(:sha) { 'dockly-FAKE-SHA' }
|
37
|
-
let(:key) { content_tag }
|
38
|
-
|
39
|
-
before { subject.tags[key] = sha }
|
40
|
-
after { subject.tags.delete(key) }
|
41
|
-
|
42
|
-
it 'returns that commit' do
|
43
|
-
expect(subject.duplicate_build_sha).to eq(sha)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe '#tags' do
|
49
|
-
let(:expected) do
|
50
|
-
{
|
51
|
-
'v1.4.0' => '708b4f1bd7846c258e2151e34f8f746b399ee6fb',
|
52
|
-
'v1.4.2' => '20b62fa084ac903a8753cfc7939c7e31c86761d2',
|
53
|
-
'v1.4.3' => '8eac23450975d91f0aa4c62c6985ec4f4ce7594f'
|
54
|
-
}
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'returns a Hash of the git tags' do
|
58
|
-
expected.each do |tag, oid|
|
59
|
-
expect(subject.tags[tag]).to include(oid)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
describe '#ls_files' do
|
65
|
-
let(:files) { subject.ls_files }
|
66
|
-
|
67
|
-
it 'returns the files checked into the repo' do
|
68
|
-
expect(files).to be_a(Array)
|
69
|
-
expect(files).to include('dockly.gemspec')
|
70
|
-
expect(files).to include('lib/dockly.rb')
|
71
|
-
expect(files).to include('spec/dockly/aws/s3_writer_spec.rb')
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
describe '#content_hash_for' do
|
76
|
-
context 'when two hashes are compared' do
|
77
|
-
let(:hash_one) { subject.content_hash_for(%w(dockly.gemspec Gemfile)) }
|
78
|
-
let(:hash_two) { subject.content_hash_for(%w(lib/dockly.rb LICENSE.txt)) }
|
79
|
-
|
80
|
-
it 'creates a unique hash for the given paths' do
|
81
|
-
expect(hash_one).to_not eq(hash_two)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
context 'when the paths are in a different order' do
|
86
|
-
let(:hash_one) { subject.content_hash_for(%w(dockly.gemspec Gemfile)) }
|
87
|
-
let(:hash_two) { subject.content_hash_for(%w(Gemfile dockly.gemspec)) }
|
88
|
-
|
89
|
-
it 'still creates the same hash' do
|
90
|
-
expect(hash_one).to eq(hash_two)
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|