dpl 1.5.11.travis.445.1 → 1.6.0.travis.399.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
- NDg1NzRiZTRmOTZmNmUyOTMzMjQ1ZjI3OTRiYjM3NmU2NTkzMmU5OQ==
4
+ MDcyNmVkMzAxNWJkZjgwNDQ5NTQyZWRmZTFhOGJhMDNiNzRjNGNhZA==
5
5
  data.tar.gz: !binary |-
6
- ZTFkYTA4OGU4YzUzMjkwMzliY2EyNWU4YmYzZWQ4YzdmYjZlZDZlMA==
6
+ ODJhNDlhZDBjN2VlMjQ2YWU5ZTI4MDkyMGExMDBjYTYyZmMxMWYwMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Njg5Y2NmMGRjNmE5NjFkNzY1OWQxNmY1MzVkNWRkNmI4MTQ4OGMwOGY0ZTY3
10
- YTJiYjYxZTcyNjNjYTJkMmIxNTNjOTYxYTM1YzA2ZTcyNGYxMzIzNmNlOTIz
11
- N2E1NmVmNDAyNmIxNjNiOWVkM2Q3MWJmNWQyYzA5NzFmOTU3NWE=
9
+ ODMxZGYyNWVjMmNiYzY2MGNkY2MzNWQ4MWYxZjdhNDlmMzU0YWJkYmE4YzAz
10
+ OTRjMDFhMjMyYmNiNzkxNGM1NmMxYjA1NDJlOTQ0ZmJmNTNiZjYxMDZlMzk5
11
+ NThhYTBmMzY4YzU4YWIzMmI4MGM4YzM2YzZhZGY2M2UzYmEyNTI=
12
12
  data.tar.gz: !binary |-
13
- Y2UxMzM2ZWJiYjAzNTM5NjFkMjJiYzE4NmE1ZTgxMTljYTc3ZjMzZGVmNGVi
14
- NDg0MjgwMjhkN2ZkYmZiYTdhOTEyMjdiZjU1ZDk2Y2EyYjM3ZTI0MGNlZjk3
15
- NzY2MjllMzllNDgxZDdhN2Q1Y2FkMzhhMGYyMDY4YTgyOWJlZDM=
13
+ Y2EzYWZhMTY0NmQ0ODZhZDY3MWQ5MDc4NzYwYjRhNzYyZDJlMzFiMTgzYmQx
14
+ MGVhODExMTNjMjc5NmZjYTk2Y2U1OWM5ZDUyMjNmYjhiOWRiYjkwODU2MTI5
15
+ MzE5NmE1NmM2YWJiODE4MTUzMWE1NjYyMzFmODBiYWM0YTRmODc=
data/README.md CHANGED
@@ -23,8 +23,6 @@ Dpl supports the following providers:
23
23
  * [Modulus](#modulus)
24
24
  * [Github Releases](#github-releases)
25
25
  * [Ninefold](#ninefold)
26
- * [Hackage](#hackage)
27
- * [Deis](#deis)
28
26
 
29
27
  ## Installation:
30
28
 
@@ -156,7 +154,7 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
156
154
  #### Examples:
157
155
 
158
156
  dpl --provider=pypi --user=<username> --password=<password>
159
- dpl --provider=pypi --user=<username> --password=<password> --server=`https://mypackageindex.com/index` --distributions='sdist bdist_wheel'
157
+ dpl --provider=pypi --user=<username> --password=<password> --server=`https://mypackageindex.com/index` --distributions='sdist bdist'
160
158
 
161
159
  ### NPM:
162
160
 
@@ -273,7 +271,6 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
273
271
  * **password**: GitHub Password. Not necessary if `api-key` is used.
274
272
  * **repo**: GitHub Repo. Defaults to git repo's name.
275
273
  * **file**: File to upload to GitHub Release.
276
- * **release-number**: Overide automatic release detection, set a release manually.
277
274
 
278
275
  #### GitHub Two Factor Authentication
279
276
 
@@ -303,27 +300,3 @@ For accounts using two factor authentication, you have to use an oauth token as
303
300
  #### Examples:
304
301
 
305
302
  dpl --provider=ninefold --auth_token=<auth_token> --app_id=<app_id>
306
-
307
- ### Hackage:
308
-
309
- #### Options:
310
-
311
- * **username**: Hackage username.
312
- * **password**: Hackage password.
313
-
314
- #### Examples:
315
-
316
- dpl --provider=hackage --username=<username> --password=<password>
317
-
318
- ### Deis:
319
-
320
- #### Options:
321
-
322
- * **controller**: Deis controller e.g. deis.deisapps.com
323
- * **username**: Deis username
324
- * **password**: Deis password
325
- * **app**: Deis app
326
-
327
- #### Examples:
328
-
329
- dpl --provider=deis --controller=deis.deisapps.com --username=travis --password=secret --app=example
data/dpl.gemspec CHANGED
@@ -22,9 +22,5 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'json'
23
23
 
24
24
  # prereleases from Travis CI
25
- if ENV['CI']
26
- digits = s.version.to_s.split '.'
27
- digits[-1] = digits[-1].to_s.succ
28
- s.version = digits.join('.') + ".travis.#{ENV['TRAVIS_JOB_NUMBER']}"
29
- end
25
+ s.version = s.version.to_s.succ + ".travis.#{ENV['TRAVIS_JOB_NUMBER']}" if ENV['CI']
30
26
  end
data/lib/dpl/provider.rb CHANGED
@@ -24,8 +24,6 @@ module DPL
24
24
  autoload :Releases, 'dpl/provider/releases'
25
25
  autoload :Cloud66, 'dpl/provider/cloud66'
26
26
  autoload :Ninefold, 'dpl/provider/ninefold'
27
- autoload :Hackage, 'dpl/provider/hackage'
28
- autoload :Deis, 'dpl/provider/deis'
29
27
 
30
28
  def self.new(context, options)
31
29
  return super if self < Provider
@@ -60,10 +58,6 @@ module DPL
60
58
  system(command)
61
59
  end
62
60
 
63
- def self.apt_get(name, command = name)
64
- context.shell("sudo apt-get -qq install #{name}", retry: true) if `which #{command}`.chop.empty?
65
- end
66
-
67
61
  def self.pip(name, command = name)
68
62
  context.shell("sudo pip install #{name}", retry: true) if `which #{command}`.chop.empty?
69
63
  end
@@ -42,7 +42,7 @@ module DPL
42
42
 
43
43
  def push_app
44
44
  branch = (dep_name == 'default') ? 'master' : dep_name
45
- context.shell "git push #{ @repository } HEAD:#{ branch } -f"
45
+ context.shell "git push #{ @repository } HEAD:#{ branch };"
46
46
  deploy_app
47
47
  end
48
48
 
@@ -19,12 +19,9 @@ module DPL
19
19
  end
20
20
 
21
21
  def check_app
22
- log "checking for app '#{option(:app)}'"
23
22
  info = api.get_app(option(:app)).body
24
23
  options[:git] ||= info['git_url']
25
- log "found app '#{info['name']}'"
26
- rescue ::Heroku::API::Errors::Forbidden => error
27
- raise Error, "#{error.message} (does the app '#{option(:app)}' exist and does your account have access to it?)", error.backtrace
24
+ log "found app #{info['name']}"
28
25
  end
29
26
 
30
27
  def setup_key(file)
@@ -59,4 +56,4 @@ module DPL
59
56
  end
60
57
  end
61
58
  end
62
- end
59
+ end
@@ -33,12 +33,7 @@ module DPL
33
33
  end
34
34
 
35
35
  def push_app
36
- if app.deployment_branch
37
- context.shell "rhc app configure #{app.name} --deployment-branch #{app.deployment_branch}"
38
- context.shell "git push #{app.git_url} -f #{app.deployment_branch}"
39
- else
40
- context.shell "git push #{app.git_url} -f"
41
- end
36
+ context.shell "git push #{app.git_url} -f"
42
37
  end
43
38
 
44
39
  def restart
@@ -6,7 +6,7 @@ module DPL
6
6
  requires 'octokit'
7
7
  requires 'mime-types'
8
8
 
9
- def get_tag
9
+ def get_tag
10
10
  `git describe --tags --exact-match 2>/dev/null`.chomp
11
11
  end
12
12
 
@@ -27,7 +27,7 @@ module DPL
27
27
  end
28
28
 
29
29
  def user
30
- @user ||= api.user
30
+ user ||= api.user
31
31
  end
32
32
 
33
33
  def needs_key?
@@ -49,7 +49,7 @@ module DPL
49
49
  unless api.scopes.include? 'public_repo' or api.scopes.include? 'repo'
50
50
  raise Error, "Dpl does not have permission to upload assets. Make sure your token contains the repo or public_repo scope."
51
51
  end
52
-
52
+
53
53
  log "Logged in as #{user.name}"
54
54
  end
55
55
 
@@ -57,15 +57,10 @@ module DPL
57
57
  tag_matched = false
58
58
  release_url = nil
59
59
 
60
- if options[:release_number]
61
- tag_matched = true
62
- release_url = "https://api.github.com/repos/" + slug + "/releases/" + options[:release_number]
63
- else
64
- releases.each do |release|
65
- if release.tag_name == get_tag
66
- release_url = release.rels[:self].href
67
- tag_matched = true
68
- end
60
+ releases.each do |release|
61
+ if release.tag_name == get_tag
62
+ release_url = release.rels[:self].href
63
+ tag_matched = true
69
64
  end
70
65
  end
71
66
 
@@ -85,7 +80,7 @@ module DPL
85
80
  if already_exists
86
81
  log "#{filename} already exists, skipping."
87
82
  else
88
- api.upload_asset(release_url, file, {:name => filename, :content_type => MIME::Types.type_for(file).first.to_s})
83
+ api.upload_asset(release_url, filename, {:content_type => MIME::Types.type_for(file).first.to_s})
89
84
  end
90
85
  end
91
86
  end
data/lib/dpl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DPL
2
- VERSION = '1.5.10'
2
+ VERSION = '1.5.9'
3
3
  end
@@ -85,7 +85,7 @@ describe DPL::Provider::CloudControl do
85
85
  it '#push_app shuld deploy the app' do
86
86
  provider.instance_variable_set(:@repository, 'foo_repo.git')
87
87
  context = double(:shell)
88
- context.should receive(:shell).with("git push foo_repo.git HEAD:master -f")
88
+ context.should receive(:shell).with("git push foo_repo.git HEAD:master;")
89
89
  provider.should receive(:context).and_return context
90
90
  provider.should receive(:deploy_app)
91
91
 
@@ -45,7 +45,7 @@ describe DPL::Provider::Heroku do
45
45
 
46
46
  describe :check_app do
47
47
  example do
48
- provider.should_receive(:log).at_least(1).times.with(/example/)
48
+ provider.should_receive(:log).with("found app example")
49
49
  provider.check_app
50
50
  provider.options[:git].should be == "GIT URL"
51
51
  end
@@ -65,19 +65,10 @@ describe DPL::Provider::Openshift do
65
65
  end
66
66
 
67
67
  describe :push_app do
68
- example "when app.deployment_branch is not set" do
69
- provider.app.should_receive :deployment_branch
68
+ example do
70
69
  provider.context.should_receive(:shell).with("git push git://something -f")
71
70
  provider.push_app
72
71
  end
73
-
74
- example "when app.deployment_branch is set" do
75
- provider.app.stub(:deployment_branch) { "test-branch" }
76
-
77
- provider.context.should_receive(:shell).with("rhc app configure example --deployment-branch test-branch")
78
- provider.context.should_receive(:shell).with("git push git://something -f test-branch")
79
- provider.push_app
80
- end
81
72
  end
82
73
 
83
74
  describe :restart do
@@ -86,8 +86,8 @@ describe DPL::Provider::Releases do
86
86
  provider.api.release.rels[:assets].stub(:get).and_return({:data => [""]})
87
87
  provider.api.release.rels[:assets].get.stub(:data).and_return([])
88
88
 
89
- provider.api.should_receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
90
- provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
89
+ provider.api.should_receive(:upload_asset).with(anything, "foo.bar", anything)
90
+ provider.api.should_receive(:upload_asset).with(anything, "bar.foo", anything)
91
91
 
92
92
  provider.push_app
93
93
  end
@@ -111,7 +111,7 @@ describe DPL::Provider::Releases do
111
111
  provider.api.release.rels[:assets].stub(:get).and_return({:data => [""]})
112
112
  provider.api.release.rels[:assets].get.stub(:data).and_return([double(:name => "foo.bar"), double(:name => "foo.foo")])
113
113
 
114
- provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
114
+ provider.api.should_receive(:upload_asset).with(anything, "bar.foo", anything)
115
115
  provider.should_receive(:log).with("foo.bar already exists, skipping.")
116
116
 
117
117
  provider.push_app
@@ -139,26 +139,8 @@ describe DPL::Provider::Releases do
139
139
  provider.api.release.rels[:assets].stub(:get).and_return({:data => nil})
140
140
  provider.api.release.rels[:assets].get.stub(:data).and_return([])
141
141
 
142
- provider.api.should_receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>""})
143
- provider.api.should_receive(:upload_asset).with(anything, "bar.foo", {:name=>"bar.foo", :content_type=>""})
144
-
145
- provider.push_app
146
- end
147
-
148
- example "With Release Number" do
149
- allow_message_expectations_on_nil
150
-
151
- provider.options.update(:file => ["bar.foo"])
152
- provider.options.update(:release_number => "1234")
153
-
154
- provider.stub(:slug).and_return("foo/bar")
155
-
156
- provider.api.stub(:release)
157
- provider.api.release.stub(:rels).and_return({:assets => nil})
158
- provider.api.release.rels[:assets].stub(:get).and_return({:data => nil})
159
- provider.api.release.rels[:assets].get.stub(:data).and_return([])
160
-
161
- provider.api.should_receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.foo", {:name=>"bar.foo", :content_type=>""})
142
+ provider.api.should_receive(:upload_asset).with(anything, "foo.bar", anything)
143
+ provider.api.should_receive(:upload_asset).with(anything, "bar.foo", anything)
162
144
 
163
145
  provider.push_app
164
146
  end
@@ -31,20 +31,6 @@ describe DPL::Provider do
31
31
  end
32
32
  end
33
33
 
34
- describe :apt_get do
35
- example "installed" do
36
- example_provider.should_receive(:`).with("which foo").and_return("/bin/foo\n")
37
- example_provider.should_not_receive(:system)
38
- example_provider.apt_get("foo")
39
- end
40
-
41
- example "missing" do
42
- example_provider.should_receive(:`).with("which foo").and_return("")
43
- example_provider.context.should_receive(:shell).with("sudo apt-get -qq install foo", retry: true)
44
- example_provider.apt_get("foo")
45
- end
46
- end
47
-
48
34
  describe :pip do
49
35
  example "installed" do
50
36
  example_provider.should_receive(:`).with("which foo").and_return("/bin/foo\n")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.11.travis.445.1
4
+ version: 1.6.0.travis.399.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-02 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -90,11 +90,9 @@ files:
90
90
  - lib/dpl/provider/cloud_files.rb
91
91
  - lib/dpl/provider/cloud_foundry.rb
92
92
  - lib/dpl/provider/cloudcontrol.rb
93
- - lib/dpl/provider/deis.rb
94
93
  - lib/dpl/provider/divshot.rb
95
94
  - lib/dpl/provider/dot_cloud.rb
96
95
  - lib/dpl/provider/engine_yard.rb
97
- - lib/dpl/provider/hackage.rb
98
96
  - lib/dpl/provider/heroku.rb
99
97
  - lib/dpl/provider/heroku/anvil.rb
100
98
  - lib/dpl/provider/heroku/git.rb
@@ -119,10 +117,8 @@ files:
119
117
  - spec/provider/cloud_files_spec.rb
120
118
  - spec/provider/cloudcontrol_spec.rb
121
119
  - spec/provider/cloudfoundry_spec.rb
122
- - spec/provider/deis_spec.rb
123
120
  - spec/provider/divshot_spec.rb
124
121
  - spec/provider/dotcloud_spec.rb
125
- - spec/provider/hackage_spec.rb
126
122
  - spec/provider/heroku_anvil_spec.rb
127
123
  - spec/provider/heroku_git_deploy_key_spec.rb
128
124
  - spec/provider/heroku_git_spec.rb
@@ -1,105 +0,0 @@
1
- module DPL
2
- class Provider
3
- class Deis < Provider
4
- experimental 'Deis'
5
- pip 'deis', 'deis'
6
-
7
- def needs_key?
8
- true
9
- end
10
-
11
- def check_auth
12
- unless context.shell "deis login #{controller_url}" \
13
- " --username=#{option(:username)}" \
14
- " --password=#{option(:password)}"
15
- error 'Login failed.'
16
- end
17
- end
18
-
19
- def check_app
20
- unless context.shell "deis apps:info --app=#{option(:app)}"
21
- error 'Application could not be verified.'
22
- end
23
- end
24
-
25
- def setup_key(file)
26
- unless context.shell "deis keys:add #{file}"
27
- error 'Adding keys failed.'
28
- end
29
- end
30
-
31
- def setup_git_ssh(path, key_path)
32
- super(path, key_path)
33
- # Deis uses a non-standard port, so we need to create a
34
- # ssh config shortcut
35
- key_path = File.expand_path(key_path)
36
- add_ssh_config_entry(key_path)
37
- # A git remote is required for running commands
38
- # https://github.com/deis/deis/issues/1086
39
- add_git_remote
40
- end
41
-
42
- def remove_key
43
- unless context.shell "deis keys:remove #{option(:key_name)}"
44
- error 'Removing keys failed.'
45
- end
46
- end
47
-
48
- def push_app
49
- wait_until_key_is_set
50
- unless context.shell "git push #{git_push_url} HEAD:refs/heads/master -f"
51
- error 'Deploying application failed.'
52
- end
53
- end
54
-
55
- def run(command)
56
- unless context.shell "deis apps:run #{command}"
57
- error 'Running command failed.'
58
- end
59
- end
60
-
61
- private
62
-
63
- def wait_until_key_is_set
64
- sleep 5
65
- end
66
-
67
- def ssh_config_entry(key_file)
68
- "\nHost deis-repo\n" \
69
- " Hostname #{option(:controller)}\n" \
70
- " Port 2222\n" \
71
- " User git\n" \
72
- " IdentityFile #{key_file}\n"
73
- end
74
-
75
- def add_ssh_config_entry(key_file)
76
- FileUtils.mkdir_p(ssh_config_dir)
77
- File.open(ssh_config, 'a') { |f| f.write(ssh_config_entry(key_file)) }
78
- end
79
-
80
- def ssh_config
81
- File.join(ssh_config_dir, 'config')
82
- end
83
-
84
- def ssh_config_dir
85
- File.join(Dir.home, '.ssh')
86
- end
87
-
88
- def add_git_remote
89
- context.shell "git remote add deis #{git_remote_url}"
90
- end
91
-
92
- def git_push_url
93
- "deis-repo:#{option(:app)}.git"
94
- end
95
-
96
- def git_remote_url
97
- "ssh://git@#{option(:controller)}:2222/#{option(:app)}.git"
98
- end
99
-
100
- def controller_url
101
- "http://#{option(:controller)}"
102
- end
103
- end
104
- end
105
- end
@@ -1,29 +0,0 @@
1
- module DPL
2
- class Provider
3
- class Hackage < Provider
4
- apt_get 'cabal', 'cabal-install'
5
-
6
- def check_auth
7
- unless option(:username) and option(:password)
8
- raise Error, "must supply username and password"
9
- end
10
- end
11
-
12
- def check_app
13
- context.shell "cabal check" or raise Error, "cabal check failed"
14
- end
15
-
16
- def needs_key?
17
- false
18
- end
19
-
20
- def push_app
21
- context.shell "cabal sdist" or raise Error, "cabal sdist failed"
22
- Dir.glob("dist/*.tar.gz") do |tar|
23
- context.shell "cabal upload --username=#{option(:username)} --password=#{option(:password)} #{tar}"
24
- end
25
- end
26
- end
27
- end
28
- end
29
-
@@ -1,98 +0,0 @@
1
- require 'spec_helper'
2
- require 'dpl/provider/deis'
3
-
4
- describe DPL::Provider::Deis do
5
- 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')
11
- end
12
-
13
- describe :needs_key? do
14
- example do
15
- expect(provider.needs_key?).to eq(true)
16
- end
17
- end
18
-
19
- describe :check_auth do
20
- example do
21
- expect(provider.context).to receive(:shell).with(
22
- 'deis login http://deis.deisapps.com --username=travis --password=secret'
23
- ).and_return(true)
24
- provider.check_auth
25
- end
26
- end
27
-
28
- describe :check_app do
29
- example do
30
- expect(provider.context).to receive(:shell).with(
31
- 'deis apps:info --app=example'
32
- ).and_return(true)
33
- provider.check_app
34
- end
35
- end
36
-
37
- describe :setup_key do
38
- let(:ssh_config_handle) { double 'ssh_config_handle' }
39
- let(:ssh_config) { File.join(Dir.home, '.ssh', 'config') }
40
- let(:identity_file) { File.join(Dir.pwd, 'key_file') }
41
- example do
42
- expect(provider.context).to receive(:shell).with(
43
- 'deis keys:add key_file'
44
- ).and_return(true)
45
- provider.setup_key('key_file')
46
- end
47
- end
48
-
49
- describe :setup_git_ssh do
50
- let(:ssh_config_handle) { double 'ssh_config_handle' }
51
- let(:ssh_config) { File.join(Dir.home, '.ssh', 'config') }
52
- let(:identity_file) { File.join(Dir.pwd, 'key_file') }
53
- let(:git_ssh) { File.join(Dir.pwd, 'foo') }
54
- after { FileUtils.rm ENV.delete('GIT_SSH') }
55
-
56
- example do
57
- expect(File).to receive(:open).with(git_ssh, 'w').and_call_original
58
- expect(File).to receive(:open).with(ssh_config, 'a')
59
- .and_yield(ssh_config_handle)
60
-
61
- expect(ssh_config_handle).to receive(:write).with(
62
- "\nHost deis-repo\n Hostname deis.deisapps.com\n Port 2222\n" \
63
- " User git\n IdentityFile #{identity_file}\n"
64
- )
65
- expect(provider.context).to receive(:shell).with(
66
- 'git remote add deis ssh://git@deis.deisapps.com:2222/example.git'
67
- )
68
- provider.setup_git_ssh('foo', 'key_file')
69
- end
70
- end
71
-
72
- describe :remove_key do
73
- example do
74
- expect(provider.context).to receive(:shell).with(
75
- 'deis keys:remove key'
76
- ).and_return(true)
77
- provider.remove_key
78
- end
79
- end
80
-
81
- describe :push_app do
82
- example do
83
- expect(provider.context).to receive(:shell).with(
84
- 'git push deis-repo:example.git HEAD:refs/heads/master -f'
85
- ).and_return(true)
86
- provider.push_app
87
- end
88
- end
89
-
90
- describe :run do
91
- example do
92
- expect(provider.context).to receive(:shell).with(
93
- 'deis apps:run shell command'
94
- ).and_return(true)
95
- provider.run('shell command')
96
- end
97
- end
98
- end
@@ -1,47 +0,0 @@
1
- require 'spec_helper'
2
- require 'dpl/provider/hackage'
3
-
4
- describe DPL::Provider::Hackage do
5
- subject :provider do
6
- described_class.new(DummyContext.new, :username => 'FooUser', :password => 'bar')
7
- end
8
-
9
- describe :check_auth do
10
- it 'should require username' do
11
- provider.options.update(:username => nil)
12
- expect {
13
- provider.check_auth
14
- }.to raise_error(DPL::Error)
15
- end
16
-
17
- it 'should require password' do
18
- provider.options.update(:password => nil)
19
- expect {
20
- provider.check_auth
21
- }.to raise_error(DPL::Error)
22
- end
23
- end
24
-
25
- describe :check_app do
26
- it 'calls cabal' do
27
- provider.context.should_receive(:shell).with("cabal check").and_return(true)
28
- provider.check_app
29
- end
30
-
31
- it 'fails when cabal complains' do
32
- provider.context.should_receive(:shell).with("cabal check").and_return(false)
33
- expect {
34
- provider.check_app
35
- }.to raise_error(DPL::Error)
36
- end
37
- end
38
-
39
- describe :push_app do
40
- example do
41
- provider.context.should_receive(:shell).with("cabal sdist").and_return(true)
42
- Dir.should_receive(:glob).and_yield('dist/package-0.1.2.3.tar.gz')
43
- provider.context.should_receive(:shell).with("cabal upload --username=FooUser --password=bar dist/package-0.1.2.3.tar.gz")
44
- provider.push_app
45
- end
46
- end
47
- end