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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Yzc1ZGUwMTNhYWFlZjY4MTQ1MDQwM2FiYTFiNDJjZjhiNDY2Yjk3Nw==
4
+ ZDAxNGUxNjUwMTgxOTA1ODI5YWQzMzljZGQwMTViMjFhNGE0OGFlYQ==
5
5
  data.tar.gz: !binary |-
6
- NGI2YzlhM2M2OGQyMTk3YjI1YjA2ZTI5Y2NiYjBjNWQ2OGRjYzc4Mg==
6
+ ODkzYTZjMjE3YzczZjhiZWY2ZTI1YjYyMTkwMjAxMzgyYzZjYmFkNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2EyNWM3YWMzOTkzNGM5OGY4OGVjYjQyYzBjZDdkYjdmMmM1N2RjMjkzNmYz
10
- NmE2ZDY5ZWVjM2E5M2NiMDk0Mzg5ZDEyY2NhMzdkZWYxOTNjMjM0Yzc3Yjkw
11
- MTQ5ZWM0MzI5NmQ2MDE3M2Q1YTFmOTczNTEzMjhmZGFjZWI0ODI=
9
+ Njk4Y2Q0MWEzYTI5NWUxNzNhYzgzNGMxZTAxNjM1ZTJhYzI4MmQ2ZmViMDk2
10
+ YTk5NzY3OTUyZWRkZGExZGMwYzdmODk1ZTNmODg2Zjg5MzU2ZDM5ZWY1ZjQ3
11
+ NDFkYjk0ZmRkOTFkZjgwM2MwYThiMmQ2N2U1MzY3MmE5MjU1MGU=
12
12
  data.tar.gz: !binary |-
13
- MThjMWRkYmQ3Y2YwZDgzOWUxYzVjOTQyNGNjYzRjZmZjMTIwMmQ5OTJmYjRl
14
- OWVkM2I3NjBiZGYxZmE4NGY4MGJmNGFiYzlhMGZkNTY5ODJhMDEwOTdmZGVh
15
- ODI3MTU4ZGVjOWQyOTFlNjFkMmI2ZDdmYmIzYTBjMmM1N2E1NGI=
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
 
@@ -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
- context.shell("sudo pip install #{name}", retry: true) if `which #{command}`.chop.empty?
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)
@@ -2,7 +2,10 @@ module DPL
2
2
  class Provider
3
3
  class Deis < Provider
4
4
  experimental 'Deis'
5
- pip 'deis', 'deis'
5
+
6
+ def install_deploy_dependencies
7
+ self.class.pip 'deis', 'deis', options[:cli_version]
8
+ end
6
9
 
7
10
  def needs_key?
8
11
  true
@@ -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, :app => 'example',
7
- :key_name => 'key',
8
- :controller => 'deis.deisapps.com',
9
- :username => 'travis',
10
- :password => 'secret')
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
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.8.travis.651.1
4
+ version: 1.7.8.travis.653.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase