dpl 1.7.8.travis.651.1 → 1.7.8.travis.653.1
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.
- checksums.yaml +8 -8
- data/README.md +1 -0
- data/lib/dpl/provider.rb +12 -3
- data/lib/dpl/provider/deis.rb +4 -1
- data/spec/provider/deis_spec.rb +24 -5
- data/spec/provider_spec.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDAxNGUxNjUwMTgxOTA1ODI5YWQzMzljZGQwMTViMjFhNGE0OGFlYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODkzYTZjMjE3YzczZjhiZWY2ZTI1YjYyMTkwMjAxMzgyYzZjYmFkNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Njk4Y2Q0MWEzYTI5NWUxNzNhYzgzNGMxZTAxNjM1ZTJhYzI4MmQ2ZmViMDk2
|
10
|
+
YTk5NzY3OTUyZWRkZGExZGMwYzdmODk1ZTNmODg2Zjg5MzU2ZDM5ZWY1ZjQ3
|
11
|
+
NDFkYjk0ZmRkOTFkZjgwM2MwYThiMmQ2N2U1MzY3MmE5MjU1MGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2Y5NzM1OGFjYmMyMzlmZTNkZDM4MWVhNWJhZDU0M2Q5ZjczNmFjMjk4Njc0
|
14
|
+
YjIzNzRmMWI4YWI1NzhmMTY5Yzk2YjUyMDRiMmQxZTAyYTljN2E4NTBiYWZi
|
15
|
+
NDBiMGNkZGUxOTgwMTUyMDVkMTY1NGNmYjdiM2Q1Y2E1NjA5ZWY=
|
data/README.md
CHANGED
@@ -349,6 +349,7 @@ For accounts using two factor authentication, you have to use an oauth token as
|
|
349
349
|
* **username**: Deis username
|
350
350
|
* **password**: Deis password
|
351
351
|
* **app**: Deis app
|
352
|
+
* **cli_version**: Install a specific deis cli version
|
352
353
|
|
353
354
|
#### Examples:
|
354
355
|
|
data/lib/dpl/provider.rb
CHANGED
@@ -42,7 +42,9 @@ module DPL
|
|
42
42
|
context.fold("Installing deploy dependencies") do
|
43
43
|
name = super.option(:provider).to_s.downcase.gsub(/[^a-z0-9]/, '')
|
44
44
|
raise Error, 'could not find provider %p' % options[:provider] unless name = constants.detect { |c| c.to_s.downcase == name }
|
45
|
-
const_get(name).new(context, options)
|
45
|
+
provider = const_get(name).new(context, options)
|
46
|
+
provider.install_deploy_dependencies if provider.respond_to?(:install_deploy_dependencies)
|
47
|
+
provider
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
@@ -73,8 +75,15 @@ module DPL
|
|
73
75
|
context.shell("sudo apt-get -qq install #{name}", retry: true) if `which #{command}`.chop.empty?
|
74
76
|
end
|
75
77
|
|
76
|
-
def self.pip(name, command = name)
|
77
|
-
|
78
|
+
def self.pip(name, command = name, version = nil)
|
79
|
+
if version
|
80
|
+
puts "sudo pip install #{name}==#{version}"
|
81
|
+
context.shell("sudo pip uninstall -y #{name}") unless `which #{command}`.chop.empty?
|
82
|
+
context.shell("sudo pip install #{name}==#{version}", retry: true)
|
83
|
+
else
|
84
|
+
puts "sudo pip install #{name}"
|
85
|
+
context.shell("sudo pip install #{name}", retry: true) if `which #{command}`.chop.empty?
|
86
|
+
end
|
78
87
|
end
|
79
88
|
|
80
89
|
def self.npm_g(name, command = name)
|
data/lib/dpl/provider/deis.rb
CHANGED
data/spec/provider/deis_spec.rb
CHANGED
@@ -2,12 +2,31 @@ require 'spec_helper'
|
|
2
2
|
require 'dpl/provider/deis'
|
3
3
|
|
4
4
|
describe DPL::Provider::Deis do
|
5
|
+
let(:options) do
|
6
|
+
{
|
7
|
+
:app => 'example',
|
8
|
+
:key_name => 'key',
|
9
|
+
:controller => 'deis.deisapps.com',
|
10
|
+
:username => 'travis',
|
11
|
+
:password => 'secret'
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
5
15
|
subject :provider do
|
6
|
-
described_class.new(DummyContext.new,
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
16
|
+
described_class.new(DummyContext.new, options)
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "#install_deploy_dependencies" do
|
20
|
+
example 'without version specified' do
|
21
|
+
expect(provider.class).to receive(:pip).with('deis', 'deis', nil)
|
22
|
+
provider.install_deploy_dependencies
|
23
|
+
end
|
24
|
+
|
25
|
+
example 'with version specified' do
|
26
|
+
options[:cli_version] = '1.0'
|
27
|
+
expect(provider.class).to receive(:pip).with('deis', 'deis', '1.0')
|
28
|
+
provider.install_deploy_dependencies
|
29
|
+
end
|
11
30
|
end
|
12
31
|
|
13
32
|
describe "#needs_key?" do
|
data/spec/provider_spec.rb
CHANGED
@@ -12,6 +12,11 @@ describe DPL::Provider do
|
|
12
12
|
example { expect(described_class.new(DummyContext.new, :provider => "Example")) .to be_an(example_provider) }
|
13
13
|
example { expect(described_class.new(DummyContext.new, :provider => "exa_mple")).to be_an(example_provider) }
|
14
14
|
example { expect(described_class.new(DummyContext.new, :provider => "exa-mple")).to be_an(example_provider) }
|
15
|
+
example "install deployment dependencies" do
|
16
|
+
expect_any_instance_of(described_class).to receive(:respond_to?).with(:install_deploy_dependencies).and_return(true)
|
17
|
+
expect_any_instance_of(described_class).to receive(:install_deploy_dependencies)
|
18
|
+
described_class.new(DummyContext.new, :provider => "example")
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
22
|
describe "#requires" do
|
@@ -57,6 +62,12 @@ describe DPL::Provider do
|
|
57
62
|
expect(example_provider.context).to receive(:shell).with("sudo pip install foo", retry: true)
|
58
63
|
example_provider.pip("foo")
|
59
64
|
end
|
65
|
+
|
66
|
+
example "specific version" do
|
67
|
+
expect(example_provider).to receive(:`).with("which foo").and_return("")
|
68
|
+
expect(example_provider.context).to receive(:shell).with("sudo pip install foo==1.0", retry: true)
|
69
|
+
example_provider.pip("foo", "foo", "1.0")
|
70
|
+
end
|
60
71
|
end
|
61
72
|
|
62
73
|
describe "#deploy" do
|